You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/07/06 12:23:57 UTC

[GitHub] [calcite] danny0405 commented on a change in pull request #1299: [CALCITE-3100] cast(? as DATE) won't work with PreparedStatement

danny0405 commented on a change in pull request #1299: [CALCITE-3100] cast(? as DATE) won't work with PreparedStatement
URL: https://github.com/apache/calcite/pull/1299#discussion_r300829405
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java
 ##########
 @@ -727,11 +736,38 @@ private Expression translateParameter(RexDynamicParam expr,
     if (storageType == null) {
       storageType = typeFactory.getJavaClass(expr.getType());
     }
-    return nullAs.handle(
-        convert(
-            Expressions.call(root, BuiltInMethod.DATA_CONTEXT_GET.method,
-                Expressions.constant("?" + expr.getIndex())),
-            storageType));
+
+    Expression expression = Expressions.call(root, BuiltInMethod.DATA_CONTEXT_GET.method,
+            Expressions.constant("?" + expr.getIndex()));
+
+    Set<SqlTypeName> toIntegerTypes = Sets.newHashSet(
+            DATE,
+            TIME,
+            TIME_WITH_LOCAL_TIME_ZONE,
+            INTERVAL_YEAR,
+            INTERVAL_YEAR_MONTH,
 
 Review comment:
   If we only support `DATE` and `TIME` type, just enum the 2 is enough, or better, we do not need this enum Set but add another convert phrase for the initial expression, 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services