walterddr commented on code in PR #11151: URL: https://github.com/apache/pinot/pull/11151#discussion_r1290098860
########## pinot-query-planner/src/test/resources/queries/AggregatePlans.json: ########## @@ -21,7 +21,7 @@ "sql": "EXPLAIN PLAN FOR SELECT AVG(a.col4) as avg, SUM(a.col4) as sum, MAX(a.col4) as max FROM a WHERE a.col3 >= 0 AND a.col2 = 'pink floyd'", "output": [ "Execution Plan", - "\nLogicalProject(avg=[/(CASE(=($1, 0), null:DECIMAL(1000, 0), $0), $1)], sum=[CASE(=($1, 0), null:DECIMAL(1000, 0), $0)], max=[$2])", + "\nLogicalProject(avg=[CAST(/(CASE(=($1, 0), null:DECIMAL(1000, 0), $0), $1)):DECIMAL(1000, 0)], sum=[CASE(=($1, 0), null:DECIMAL(1000, 0), $0)], max=[$2])", Review Comment: the `cast`s are actually being done as part of the transform operation. it might not be ideal but i think for now we should be good (let's add a comment?) ########## pinot-query-planner/src/main/java/org/apache/pinot/query/type/TypeSystem.java: ########## @@ -32,6 +32,9 @@ public class TypeSystem extends RelDataTypeSystemImpl { private static final int MAX_DECIMAL_SCALE_DIGIT = 1000; private static final int MAX_DECIMAL_PRECISION_DIGIT = 1000; + private static final int DERIVED_DECIMAL_PRECISION = 19; + private static final int DERIVED_DECIMAL_SCALE = 1; Review Comment: add some comments regarding these 2 constant? (also nit can you remove the `_DIGIT` in the previous 2 constants?) -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org