You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "walterddr (via GitHub)" <gi...@apache.org> on 2023/02/22 14:59:29 UTC

[GitHub] [pinot] walterddr commented on a diff in pull request #10314: [multistage] Fix return type for AVG aggregate function

walterddr commented on code in PR #10314:
URL: https://github.com/apache/pinot/pull/10314#discussion_r1114451434


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/type/TypeSystem.java:
##########
@@ -50,4 +53,11 @@ public int getMaxNumericScale() {
   public int getMaxNumericPrecision() {
     return MAX_DECIMAL_PRECISION_DIGIT;
   }
+
+  @Override
+  public RelDataType deriveAvgAggType(RelDataTypeFactory typeFactory,
+      RelDataType argumentType) {
+    return typeFactory.createTypeWithNullability(
+        typeFactory.createSqlType(SqlTypeName.DOUBLE), false);

Review Comment:
   This is not the right way to fix the issue. we should rely on Calcite's derived type system to figure out what the return type should be. this way all AGG results are returning as double which is going to cause more issue than it resolves. 



-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org