-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import t from '/Users/ltabb/Downloads/agg_levels.json'; | ||
|
||
const allDims = new Map<string, string>(); | ||
|
||
for (const a of t) { | ||
for (const dim of a.agg_level.split('.')) { | ||
allDims.set(dim, 'x'); | ||
} | ||
} | ||
|
||
console.log(` | ||
##! experimental{composite_sources} | ||
source: cube_root is presto_de.table('peu_cube_agg_level:measurementsystems')`); | ||
|
||
for (const cube of t) { | ||
const name = '`cube' + cube.agg_level + '`'; | ||
const levels = cube.agg_level.split('.'); | ||
const except = | ||
'`' + | ||
Array.from(allDims.keys()) | ||
.filter(x => !levels.includes(x)) | ||
.join('`,`') + | ||
'`'; | ||
console.log(` | ||
source: \`cube.${cube.agg_level}\` is cube_root extend { | ||
except: ${except} | ||
where: agg_level = '${cube.agg_level}' | ||
} | ||
`); | ||
} | ||
|
||
console.log(`source: cube_base is compose(`); | ||
Check warning on line 32 in scripts/describe_cube.ts GitHub Actions / test-all (18.x)
|
||
console.log('`' + t.map(x => 'cube.' + x.agg_level).join('`,`') + '`'); | ||
console.log(`)`); | ||
Check warning on line 34 in scripts/describe_cube.ts GitHub Actions / test-all (18.x)
|