You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "DonnyZone (via GitHub)" <gi...@apache.org> on 2023/05/16 08:02:06 UTC

[GitHub] [calcite] DonnyZone commented on a diff in pull request #3203: [CALCITE-5703] Reduce amount of generated runtime code

DonnyZone commented on code in PR #3203:
URL: https://github.com/apache/calcite/pull/3203#discussion_r1194771871


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java:
##########
@@ -1164,10 +1164,9 @@ public Expression handle(Expression x) {
 
   static Expression getDefaultValue(Type type) {
     Primitive p = Primitive.of(type);
-    if (p != null) {
-      return Expressions.constant(p.defaultValue, type);
-    }
-    return Expressions.constant(null, type);
+    return p != null
+        ? Expressions.constant(p.defaultValue, type)
+        : Expressions.constant(null);

Review Comment:
   The change makes the expression type information missing. It is a static function. I have concern on the type mismatch for some cases.



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

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