xuzifu666 commented on code in PR #5019:
URL: https://github.com/apache/calcite/pull/5019#discussion_r3425163533
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java:
##########
@@ -1250,6 +1251,7 @@ void populate2() {
NotJsonImplementor.of(
new MethodImplementor(BuiltInMethod.IS_JSON_SCALAR.method,
NullPolicy.NONE, false)));
+ define(FILTER, new FilterImplementor());
Review Comment:
The FILTER operator implements conditional aggregation in SQL, such as:
``` SUM(salary) FILTER (WHERE department = 'Sales') COUNT(*) FILTER (WHERE
age > 30)```
Processing Pipeline:
1. SQL Parsing → ```FILTER (WHERE condition)``` parsed as
```SqlKind.FILTER``` node
2. Validation → Checks aggregate-FILTER compatibility (we reject
```COUNT(DISTINCT) + FILTER``` in window functions)
3. SQL-to-Relational Conversion → FILTER condition extracted and stored
4. Code Generation → Registers FilterImplementor to translate FILTER into
executable code
I had added a comment about it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]