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/03/21 08:08:54 UTC

[GitHub] [calcite] julianhyde commented on a change in pull request #1120: [CALCITE-2933] Add timestamp extract for casts from timestamp type to…

julianhyde commented on a change in pull request #1120: [CALCITE-2933] Add timestamp extract for casts from timestamp type to…
URL: https://github.com/apache/calcite/pull/1120#discussion_r267651445
 
 

 ##########
 File path: druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java
 ##########
 @@ -241,6 +241,14 @@ public static DruidQuery extendQuery(DruidQuery query,
         query.druidTable, intervals, query.rels, query.getOperatorConversionMap());
   }
 
+  /** Check if it is needed to use UTC for DATE and TIMESTAMP types. **/
+  private static boolean needUTCTimeExtract(RexNode rexNode) {
+    return rexNode.getType().getSqlTypeName() == SqlTypeName.DATE
+        || rexNode.getType().getSqlTypeName() == SqlTypeName.TIMESTAMP
+        || rexNode.getType().getSqlTypeName()
+        == SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE;
 
 Review comment:
   can you rename the function to `needUtcTimeExtract`. house style is to camel-case acronyms such as 'UTC' and 'SQL' into 'Utc' and 'Sql'

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