Dwrite commented on code in PR #4339:
URL: https://github.com/apache/calcite/pull/4339#discussion_r2215815937
##########
core/src/main/java/org/apache/calcite/sql/parser/StringAndPos.java:
##########
@@ -52,8 +53,54 @@ private StringAndPos(String sql, int cursor, @Nullable
SqlParserPos pos) {
}
/**
- * Looks for one or two carets in a SQL string, and if present, converts
- * them into a parser position.
+ * Checks if the SQL expression is a simple XOR pattern that can be safely
processed.
+ *
+ * <p>This method provides special handling for the BITXOR_OPERATOR (^) in
Apache Calcite
Review Comment:
Thanks for the suggestion!
However, simply treating a string with a single caret (^) as a literal
character won't work in practice — it causes some of our test cases to fail,
particularly those involving parsing or validation errors where caret-based
range highlighting is required.
That’s why we use patterns like ^...^ or more structured escape sequences —
they provide clarity and work consistently across different test scenarios.
Happy to adjust the pattern matching logic if you have a concrete suggestion
that avoids this ambiguity, but we do need some kind of disambiguation.
--
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]