-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(tesseract): Basic pre-aggregations support #9434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
dd4cb55
1257056
33220df
2f77221
9db6bba
1e0deb1
2c688c6
3f92ac1
0b93d8d
6b1e52b
a46541a
50bf6f8
a3b71aa
88e68a4
96b5814
3715135
34c7040
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -559,7 +559,7 @@ | |
transformedQuery.filterDimensionsSingleValueEqual || {}, | ||
) | ||
)); | ||
|
||
const backAlias = (references) => references.map(r => ( | ||
Array.isArray(r) ? | ||
[transformedQuery.allBackAliasMembers[r[0]] || r[0], r[1]] : | ||
|
@@ -782,11 +782,15 @@ | |
*/ | ||
findPreAggregationForQuery() { | ||
if (!this.preAggregationForQuery) { | ||
this.preAggregationForQuery = | ||
this | ||
.rollupMatchResults() | ||
// Refresh worker can access specific pre-aggregations even in case those hidden by others | ||
.find(p => p.canUsePreAggregation && (!this.query.options.preAggregationId || p.preAggregationId === this.query.options.preAggregationId)); | ||
if (this.query.useNativeSqlPlanner && this.query.canUseNativeSqlPlannerPreAggregation) { | ||
this.preAggregationForQuery = this.query.findPreAggregationForQueryRust(); | ||
} else { | ||
this.preAggregationForQuery = | ||
this | ||
.rollupMatchResults() | ||
// Refresh worker can access specific pre-aggregations even in case those hidden by others | ||
.find(p => p.canUsePreAggregation && (!this.query.options.preAggregationId || p.preAggregationId === this.query.options.preAggregationId)); | ||
} | ||
} | ||
return this.preAggregationForQuery; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. From this.query.findPreAggregationForQueryRust() code
Yeah, I know it’s not very elegant, but it’s pretty much the only fast way to splice the logic together until the whole PreAggregation part moves into Tesseract. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not return it instead of setting? Thus you can keep the logic similar and clean. |
||
} | ||
|
@@ -866,6 +870,25 @@ | |
)(preAggregations); | ||
} | ||
|
||
getRollupPreAggregationByName(cube, preAggregationName) { | ||
const canUsePreAggregation = () => true; | ||
const preAggregation = R.pipe( | ||
R.toPairs, | ||
R.filter(([_, a]) => a.type === 'rollup' || a.type === 'rollupJoin' || a.type === 'rollupLambda'), | ||
R.find(([k, _]) => k === preAggregationName) | ||
)(this.query.cubeEvaluator.preAggregationsForCube(cube)); | ||
if (preAggregation) { | ||
const tableName = this.preAggregationTableName(cube, preAggregation[0], preAggregation[1]); | ||
const preAggObj = preAggregation ? this.evaluatedPreAggregationObj(cube, preAggregation[0], preAggregation[1], canUsePreAggregation) : {}; | ||
return { | ||
tableName, | ||
...preAggObj | ||
}; | ||
} else { | ||
return {}; | ||
} | ||
} | ||
|
||
// TODO check multiplication factor didn't change | ||
buildRollupJoin(preAggObj, preAggObjsToJoin) { | ||
return this.query.cacheValue( | ||
|
Uh oh!
There was an error while loading. Please reload this page.