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/01/02 18:34:06 UTC

[GitHub] [calcite] amaliujia commented on a change in pull request #1714: [Calcite 3663] Support for TRIM function in BigQuery dialect

amaliujia commented on a change in pull request #1714: [Calcite 3663] Support for TRIM function in BigQuery dialect
URL: https://github.com/apache/calcite/pull/1714#discussion_r362579227
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java
 ##########
 @@ -192,6 +197,37 @@ public BigQuerySqlDialect(SqlDialect.Context context) {
     }
   }
 
+  /**
+   * For usage of TRIM, LTRIM and RTRIM in BQ see
+   * <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#trim">
+   *  BQ Trim Function</a>.
+   */
+  private void unparseTrim(SqlWriter writer, SqlCall call, int leftPrec,
+      int rightPrec) {
+    assert call.operand(0) instanceof SqlLiteral : call.operand(0);
 
 Review comment:
   Also need to validate the second operand?

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