Skip to content

feat: Allow additional filters in PatchMeasure for number measures #9468

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,14 @@
case 'count_distinct_approx':
// ok, do nothing
break;
case 'number':
// Additional filters for `number` measures should be propagated to leaf measures
// And only leaf `number` measures should trigger an error
throw new UserError(

Check warning on line 87 in packages/cubejs-schema-compiler/src/adapter/BaseMeasure.ts

View check run for this annotation

Codecov / codecov/patch

packages/cubejs-schema-compiler/src/adapter/BaseMeasure.ts#L87

Added line #L87 was not covered by tests
`Additional filters for measure ${sourceMeasure} type ${source.type} are supported only in Tesseract`
);
default:
// Can not add filters to string, time, boolean, number
// Can not add filters to string, time, boolean
// Aggregation is already included in SQL, it's hard to patch that
throw new UserError(
`Unsupported additional filters for measure ${sourceMeasure} type ${source.type}`
Expand Down
4 changes: 3 additions & 1 deletion rust/cubesql/cubesql/src/transport/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@
| "max"
| "count"
| "count_distinct"
| "count_distinct_approx" => true,
| "count_distinct_approx"

Check warning on line 96 in rust/cubesql/cubesql/src/transport/ext.rs

View check run for this annotation

Codecov / codecov/patch

rust/cubesql/cubesql/src/transport/ext.rs#L96

Added line #L96 was not covered by tests
// For number measures new filter should be propagated to leaf measures
| "number" => true,
_ => false,
}
}
Expand Down
Loading