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

 ##########
 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:
   Good idea. Added a `Long.parseLong` to validate if the value string is a 
long.
   
   By doing so I have to change the test because seems like it usually the 
range time unit has a non long value. So I lose the test of checking range time 
unit.

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