Skip to content

Commit 898c75a

Browse files
committed
[WIP add test] feat(cubesql): Allow additional filters in PatchMeasure for number measures
1 parent 91e3af6 commit 898c75a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,14 @@ export class BaseMeasure {
8181
case 'count_distinct_approx':
8282
// ok, do nothing
8383
break;
84+
case 'number':
85+
// Additional filters for `number` measures should be propagated to leaf measures
86+
// And only leaf `number` measures should trigger an error
87+
throw new UserError(
88+
`Additional filters for measure ${sourceMeasure} type ${source.type} are supported only in Tesseract`
89+
);
8490
default:
85-
// Can not add filters to string, time, boolean, number
91+
// Can not add filters to string, time, boolean
8692
// Aggregation is already included in SQL, it's hard to patch that
8793
throw new UserError(
8894
`Unsupported additional filters for measure ${sourceMeasure} type ${source.type}`

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ impl V1CubeMetaMeasureExt for CubeMetaMeasure {
9393
| "max"
9494
| "count"
9595
| "count_distinct"
96-
| "count_distinct_approx" => true,
96+
| "count_distinct_approx"
97+
// For number measures new filter should be propagated to leaf measures
98+
| "number" => true,
9799
_ => false,
98100
}
99101
}

0 commit comments

Comments
 (0)