You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "abhioncbr (via GitHub)" <gi...@apache.org> on 2023/06/10 00:11:53 UTC

[GitHub] [pinot] abhioncbr commented on a diff in pull request #10814: [multistage][float-double-comparison]: updated for CAST function addition based on correct precision.

abhioncbr commented on code in PR #10814:
URL: https://github.com/apache/pinot/pull/10814#discussion_r1224908703


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/type/TypeSystem.java:
##########
@@ -70,4 +70,16 @@ public RelDataType deriveAvgAggType(RelDataTypeFactory typeFactory,
       }
     }
   }
+
+  // overriding the function for handling comparison between different data types.
+  // based on the precision value calcite adds the CAST function to make operands of same type for comparison.
+  @Override public int getDefaultPrecision(SqlTypeName typeName) {
+    switch (typeName) {
+      case DOUBLE:
+        return 16;
+      default:
+        // Following BasicSqlType precision as the default
+        return super.getDefaultPrecision(typeName);
+    }

Review Comment:
   Well, I changed the `TypeFactory` extending`SqlTypeFactoryImpl` instead of  `JavaTypeFactoryImpl`, and there is no effect on our test suite. Here are the [changes](https://github.com/apache/pinot/pull/10883).  
   I will say either our test suite isn't complete to cover complete testing or it doesn't matter if we extend either type. Let me look `TypeCoercion` logic. 



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