mihaibudiu commented on code in PR #3733:
URL: https://github.com/apache/calcite/pull/3733#discussion_r1575207451


##########
druid/src/test/java/org/apache/calcite/test/DruidAdapter2IT.java:
##########
@@ -1909,10 +1909,14 @@ private void checkGroupBySingleSortLimit(boolean 
approx) {
         + "end as b from \"foodmart\"  group by \"store_state\" order by a 
desc";
     final String postAggString = 
"'postAggregations':[{'type':'expression','name':'A',"
         + "'expression':'(\\'$f1\\' / 
\\'$f2\\')'},{'type':'expression','name':'B',"
-        + "'expression':'case_searched((\\'$f3\\' == 0),1.0,CAST(\\'$f3\\'";
+        + "'expression':'case_searched((\\'$f3\\' == 0),1,CAST(\\'$f3\\'";
     final String plan = "PLAN="
         + "EnumerableInterpreter\n"
-        + "  DruidQuery(table=[[foodmart, foodmart]], 
intervals=[[1900-01-09T00:00:00.000Z/2992-01-10T00:00:00.000Z]], 
projects=[[$63, $90, $91, $89]], groups=[{0}], aggs=[[SUM($1), SUM($2), 
SUM($3)]], post_projects=[[$0, /($1, $2), CASE(=($3, 0), 1.0:DECIMAL(19, 0), 
CAST($3):DECIMAL(19, 0))]], sort0=[1], dir0=[DESC])\n";
+        + "  DruidQuery(table=[[foodmart, foodmart]],"
+        + " intervals=[[1900-01-09T00:00:00.000Z/2992-01-10T00:00:00.000Z]],"
+        + " projects=[[$63, $90, $91, $89]], groups=[{0}], aggs=[[SUM($1), 
SUM($2), SUM($3)]],"
+        + " post_projects=[[$0, /($1, $2), CASE(=($3, 0), CAST(1:DECIMAL(19, 
0)):DECIMAL(19, 0),"

Review Comment:
   I suspect this is some lack of optimization in the Druid code generator, 
which doesn't remove redundant casts. If we think this is a bug, I suggest we 
file a new issue to deal with it.



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

Reply via email to