cloud-fan commented on code in PR #43801:
URL: https://github.com/apache/spark/pull/43801#discussion_r1400437832
##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/util/V2ExpressionSQLBuilder.java:
##########
@@ -48,6 +48,26 @@
*/
public class V2ExpressionSQLBuilder {
+ protected String escapeSpecialCharsForLikePattern(String str) {
+ StringBuilder builder = new StringBuilder();
+
+ for (char c : str.toCharArray()) {
+ switch (c) {
+ case '_':
+ builder.append("\\_");
+ break;
+ case '%':
+ builder.append("\\%");
+ break;
+ // TODO Support for escaping more special characters
Review Comment:
It's not a TODO. We should document `escapeSpecialCharsForLikePattern` and
ask dialects to override it if they have more special chars other than `_` and
`%`.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]