samarthjain commented on a change in pull request #8099: Fix druid sql group by 
queries returning complex aggregation type
URL: https://github.com/apache/incubator-druid/pull/8099#discussion_r305041468
 
 

 ##########
 File path: sql/src/main/java/org/apache/druid/sql/calcite/rel/Projection.java
 ##########
 @@ -193,11 +194,14 @@ private static boolean postAggregatorDirectColumnIsOk(
       return false;
     }
 
-    // Check if a cast is necessary.
-    final ExprType toExprType = Expressions.exprTypeForValueType(
-        aggregateRowSignature.getColumnType(expression.getDirectColumn())
-    );
+    // We don't really have a way to cast complex type. So might as well not 
do anything and return.
+    final ValueType columnValueType = 
aggregateRowSignature.getColumnType(expression.getDirectColumn());
+    if (expression.isDirectColumnAccess() && columnValueType == 
ValueType.COMPLEX) {
 
 Review comment:
   > Main code looks good, just had one comment about a needless check.
   > 
   > Could you also include a regression unit test that fails in master but 
passes with this patch? Maybe BloomFilterSqlAggregatorTest would be a good spot 
to put it.
   > 
   > I'd suggest including a comment like,
   > 
   > ```
   > // Regression test for 
https://github.com/apache/incubator-druid/issues/8093.
   > ```
   
   Removed the check. 
   
   I have a PR out for SQL support for t-digests that has a test 
testGeneratingSketchAndComputingQuantileOnFly 
(https://github.com/apache/incubator-druid/pull/8100/commits/952a55393acf244ab6bcd9e0ddc298b47cbf1cdf#diff-506b4b10165c4dd7af44701956a3cea5R267)
  that fails without this patch.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to