You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "olivrlee (via GitHub)" <gi...@apache.org> on 2023/04/26 18:12:02 UTC

[GitHub] [calcite] olivrlee commented on a diff in pull request #3178: [CALCITE-5677] Fix unparsing for BigQuery SUBSTR

olivrlee commented on code in PR #3178:
URL: https://github.com/apache/calcite/pull/3178#discussion_r1178234063


##########
core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java:
##########
@@ -185,6 +186,21 @@ public BigQuerySqlDialect(SqlDialect.Context context) {
     case TRIM:
       unparseTrim(writer, call, leftPrec, rightPrec);
       break;
+    case OTHER_FUNCTION:
+      if (call.getOperator() instanceof SqlSubstringFunction) {
+        final SqlWriter.Frame funCallFrame = writer.startFunCall(call.getOperator().getName());
+        call.operand(0).unparse(writer, leftPrec, rightPrec);
+        writer.sep(",", true);
+        call.operand(1).unparse(writer, leftPrec, rightPrec);
+        if (3 == call.operandCount()) {

Review Comment:
   nit: switch the ordering of these 



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

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org