danny0405 commented on a change in pull request #1588: [CALCITE-3381] Unparse 
to correct BigQuery interval syntax: "INTERVAL…
URL: https://github.com/apache/calcite/pull/1588#discussion_r349450465
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java
 ##########
 @@ -154,6 +158,49 @@ public BigQuerySqlDialect(SqlDialect.Context context) {
     }
   }
 
+  /** BigQuery interval syntax: INTERVAL int64 time_unit. */
+  @Override public void unparseSqlIntervalLiteral(
+          SqlWriter writer, SqlIntervalLiteral literal, int leftPrec, int 
rightPrec) {
+    SqlIntervalLiteral.IntervalValue interval =
+            (SqlIntervalLiteral.IntervalValue) literal.getValue();
 
 Review comment:
   Calcite allows a pure string interval value, if BigQuery only allows `int64` 
format, we should check and throw for other non-integers values.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to