ColinLeeo commented on code in PR #18982:
URL: https://github.com/apache/iotdb/pull/18982#discussion_r4345432314
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java:
##########
@@ -1573,9 +1576,11 @@ private void analyzeWhere(
if (!queryStatement.hasWhere()) {
return;
}
+ Expression wherePredicate =
+
PredicateUtils.predicateRemoveNot(queryStatement.getWhereCondition().getPredicate());
Review Comment:
Addressed. The rewrite now runs after schema binding and
`ReversePredicateVisitor` retains `NOT` when the operand is not safely
invertible.
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java:
##########
@@ -1030,10 +1030,12 @@ private void analyzeHavingBase(
ISchemaTree schemaTree,
UnaryOperator<Expression> havingExpressionAnalyzer,
MPPQueryContext queryContext) {
+ Expression havingPredicate =
+
PredicateUtils.predicateRemoveNot(queryStatement.getHavingCondition().getPredicate());
Review Comment:
Fixed at the root instead. `BindSchemaForPredicateVisitor` now resets the
root context when descending through unary expressions, so `NOT (A AND B)` is
no longer split into `NOT A AND NOT B`. Composite HAVING tests were added for
both normal and GROUP BY LEVEL paths.
--
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]