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 2020/05/28 04:32:35 UTC

[GitHub] [calcite] wenhuitang commented on a change in pull request #1990: [CALCITE-4026] When the cassandra primary key is of type bigint,the query will report an error

wenhuitang commented on a change in pull request #1990:
URL: https://github.com/apache/calcite/pull/1990#discussion_r431575566



##########
File path: cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraFilter.java
##########
@@ -174,14 +174,13 @@ private String translateMatch(RexNode condition) {
       }
     }
 
-    /** Convert the value of a literal to a string.
+    /** Returns the value of the literal.
      *
      * @param literal Literal to translate
-     * @return String representation of the literal
+     * @return The value of the literal in the form of the actual type.
      */
-    private static String literalValue(RexLiteral literal) {
-      Object value = literal.getValue2();
-      return String.valueOf(value);
+    private static Object literalValue(RexLiteral literal) {
+      return literal.getValue2();
     }

Review comment:
       > For `Integral` and `string` it is correct, but i'm not sure if it is for other data types literal, such as `TIMESTAMP(3)`, can you make sure that ?
   
   Thanks a lot for reviewing. This PR has been updated.
   I have tested for type like Date, Timestamp and Time.
   1.When the type of primary key 'f_time' is Time, it will throw exception when the filter condition is "f_time = Time '13:30:54.234'", because the type of 'f_time' is Bigint.
   It seems another issue.
   2.As for Timestamp(3), CassandraSchema create a Sql type Timestamp with precision 0. So It is possible to lose precision when get timestamp data from Cassandra.
   
   As for above two issues, Whether we should solve them at this PR or creat new jira issues for them?




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