tanclary commented on code in PR #3565:
URL: https://github.com/apache/calcite/pull/3565#discussion_r1432903605
##########
core/src/main/java/org/apache/calcite/sql/dialect/SnowflakeSqlDialect.java:
##########
@@ -36,6 +39,30 @@ public SnowflakeSqlDialect(Context context) {
super(context);
}
+ @Override public void unparseCall(final SqlWriter writer, final SqlCall
call, final int leftPrec,
+ final int rightPrec) {
+ switch(call.getKind()) {
+ case ENDS_WITH:
+ case STARTS_WITH:
+ unparseEndsStartsWith(writer, call);
+ break;
+ default:
+ super.unparseCall(writer, call, leftPrec, rightPrec);
+ }
+ }
+
+ /**
+ * Remove underscore for {@code STARTS_WITH} and {@code ENDS_WITH}
operators to
+ * comply with Snowflake syntax.
+ */
+ private static void unparseEndsStartsWith(final SqlWriter writer, final
SqlCall call) {
+ final String name = call.getKind() == SqlKind.ENDS_WITH ? "ENDSWITH" :
"STARTSWITH";
Review Comment:
I rewrote this bit in my latest commit.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]