mihaibudiu commented on code in PR #4896:
URL: https://github.com/apache/calcite/pull/4896#discussion_r3112894634
##########
elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRules.java:
##########
@@ -263,8 +265,42 @@ protected ElasticsearchAggregateRule(Config config) {
super(config);
}
+ /**
+ * Checks if the relational expression or any of its inputs
+ * is an Aggregate (LogicalAggregate or ElasticsearchAggregate).
+ * This prevents nested aggregations from being pushed down to
Elasticsearch.
Review Comment:
The second part of this comment should be where the function is called.
##########
elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRules.java:
##########
@@ -263,8 +265,42 @@ protected ElasticsearchAggregateRule(Config config) {
super(config);
}
+ /**
+ * Checks if the relational expression or any of its inputs
+ * is an Aggregate (LogicalAggregate or ElasticsearchAggregate).
+ * This prevents nested aggregations from being pushed down to
Elasticsearch.
+ */
+ private static boolean containsAggregate(RelNode node) {
+ // Handle RelSubset by checking its best or original node
+ if (node instanceof RelSubset) {
Review Comment:
I don't really understand what happens with RelSubset, maybe you can explain
a bit more.
--
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]