FrankChen021 commented on code in PR #20094:
URL: https://github.com/apache/druid/pull/20094#discussion_r3821774053


##########
sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidCorrelateUnnestRel.java:
##########
@@ -282,21 +283,26 @@ public DruidQuery toDruidQuery(boolean 
finalizeAggregations)
       final Filter whereFilter = 
newLeftDruidRel.getPartialDruidQuery().getWhereFilter();
       final RowSignature leftSignature = 
DruidRels.dataSourceSignature(newLeftDruidRel);
       if (whereFilter == null) {
-        if (computeLeftRequiresSubquery(newLeftDruidRel)) {
+        if (computeLeftRequiresSubquery(newLeftDruidRel) || 
updatedLeftQuery.getQuery() instanceof GroupByQuery) {

Review Comment:
   [P1] GroupBy detection is unreachable
   
   This check runs only when the partial-query stage is SCAN, WHERE_FILTER, or 
SELECT_PROJECT. DruidQuery emits GroupByQuery only when an aggregate exists, 
which places the stage at AGGREGATE or later. Therefore the new condition 
cannot change the data-source choice for the reported grouped-left-side case, 
leaving the fix ineffective.



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