Skip to content

feat(tesseract): Pre-aggregation planning fallback #9230

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

Merged
merged 2 commits into from
Mar 3, 2025

Conversation

waralexrom
Copy link
Member

Check List

  • Tests have been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Issue Reference this PR resolves

[For example #12]

Description of Changes Made (if issue reference is not provided)

[Description goes here]

@waralexrom waralexrom requested review from a team as code owners February 17, 2025 15:30
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.69%. Comparing base (405a604) to head (10bdac5).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9230   +/-   ##
=======================================
  Coverage   83.69%   83.69%           
=======================================
  Files         228      228           
  Lines       82016    82016           
=======================================
  Hits        68640    68640           
  Misses      13376    13376           
Flag Coverage Δ
cubesql 83.69% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@KSDaemon KSDaemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good. Left some minor notes and typos fixes...

@@ -278,11 +278,9 @@ export class BaseQuery {
return dimension;
}).filter(R.identity).map(this.newTimeDimension.bind(this));
this.allFilters = this.timeDimensions.concat(this.segments).concat(this.filters);
this.useNativeSqlPlanner = this.options.useNativeSqlPlanner ?? getEnv('nativeSqlPlanner');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add .default('false') to this env so the useNativeSqlPlanner can be always bool.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -603,33 +609,61 @@ export class BaseQuery {
return false;
}

newQueryNotUseNative() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
newQueryNotUseNative() {
newQueryWithoutNative() {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +640 to +652
if (this.options.disableExternalPreAggregations && preAggForQuery && preAggForQuery.preAggregation.external) {
preAggForQuery = undefined;
}
if (preAggForQuery) {
isRelatedToPreAggregation = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like these 2 ifs can be combined into one. Smth like:

if (!(this.options.disableExternalPreAggregations && 
preAggForQuery && 
preAggForQuery.preAggregation.external)) {
  isRelatedToPreAggregation = true;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current version seems more readable to me. In any case, this is a very temporary solution

@@ -2960,6 +2994,7 @@ export class BaseQuery {
}

newSubQueryForCube(cube, options) {
options = { ...options, useNativeSqlPlanner: false }; // We not use tesseract for pre-aggregations generation yet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
options = { ...options, useNativeSqlPlanner: false }; // We not use tesseract for pre-aggregations generation yet
options = { ...options, useNativeSqlPlanner: false }; // We don't use tesseract for pre-aggregations generation yet

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@waralexrom waralexrom force-pushed the tesseract-exclude-values-from-filter-params branch from 06ae94b to 4a80bc5 Compare March 2, 2025 15:49
@waralexrom waralexrom force-pushed the tesseract-fallback-to-js-on-pre-aggregations branch from ab46752 to cc70404 Compare March 2, 2025 16:08
Copy link
Member

@KSDaemon KSDaemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

Base automatically changed from tesseract-exclude-values-from-filter-params to master March 3, 2025 12:56
@waralexrom waralexrom force-pushed the tesseract-fallback-to-js-on-pre-aggregations branch from cc70404 to 10bdac5 Compare March 3, 2025 13:00
@waralexrom waralexrom merged commit 08650e2 into master Mar 3, 2025
74 checks passed
@waralexrom waralexrom deleted the tesseract-fallback-to-js-on-pre-aggregations branch March 3, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants