[multistage][agg] support agg with filter#11144
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11144 +/- ##
==========================================
- Coverage 0.11% 0.11% -0.01%
==========================================
Files 2223 2225 +2
Lines 119273 119588 +315
Branches 18055 18109 +54
==========================================
Hits 137 137
- Misses 119116 119431 +315
Partials 20 20
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 18 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
0f55841 to
4c0165d
Compare
There was a problem hiding this comment.
i dont know if this is the best API in DataBlockUtils to extract this. alternative is to extract the filter booleans and the IntValues separately, but i cannot make this change individually without changing how agg functions work.
There was a problem hiding this comment.
Is it possible to create a FilteredTransferableBlock wrapping up TransferableBlock for AggregateOperator and others to use?
There was a problem hiding this comment.
Feeling shouldn't use these many if-else checks
4c0165d to
b18b6fd
Compare
* [init][agg] support agg filter where clause * limitation still applies for nullable vs non-nullable results and agg filter merging with select filter, will be address in follow ups. --------- Co-authored-by: Rong Rong <rongr@startree.ai>
enable theta sketch test for v2 after apache#11144 and apache#11153 Co-authored-by: Rong Rong <rongr@startree.ai>
Description
Support syntax
AGG_FUN(...) FILTER (WHERE ...), such as:SELECT sum(val) FILTER (WHERE col > 10) FROM tblFollow ups
Major
IS NULLandIS NOT NULLas agg filter is not supportedSELECT COUNT(*) FILTER (WHERE a = 1 OR a = 2) FROM tbl WHERE a = 2will result in a compilation errorMinor
ServerPlanRequestVisitor: agg with filter and group-by causes conversion issue on v1 if the group-by field is not in the select list -- work around: selecting out all the group-by fieldsINclause not supported: FILTER WHERE clause with IN hard-wired to translate into subquery in calcite for some reason -- work around: use OR and equal