sreemanamala commented on code in PR #16402:
URL: https://github.com/apache/druid/pull/16402#discussion_r1598315845


##########
sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/GroupingSqlAggregator.java:
##########
@@ -90,7 +91,17 @@ public Aggregation toDruidAggregation(
         }
       }
     }
-    AggregatorFactory factory = new GroupingAggregatorFactory(name, arguments);
+    AggregatorFactory factory;
+    try {
+      factory = new GroupingAggregatorFactory(name, arguments);
+    }
+    catch (Exception e) {

Review Comment:
   1. These exceptions which would be thrown here would result in not being 
able to plan the query in the current path and look for other ways. The custom 
rule which is introduced in this PR will make sure that the duplicate grouping 
would be removed and plan the query properly. In my understanding, the user 
would face this exception if the query  can not be planned at all. As part of 
this testcase which I have added, Initially this would fail in plan and then 
turns towards the rule, gets converted and generated the final plan.
   2. By setting the planning error with the exception being received, this 
should be able to distinguish between the different exceptions based on the 
message



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to