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


##########
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:
   The code I wrote in this PR does not modify the program representation in 
any way. It only changes the way constant expressions involving casts are 
evaluated. I will try to find out what is going on here, though. So this must 
be some interaction with the optimizer.



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