cloud-fan commented on code in PR #43801:
URL: https://github.com/apache/spark/pull/43801#discussion_r1398653848
##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/QuotingUtils.scala:
##########
@@ -71,4 +71,17 @@ object QuotingUtils {
builder.toString()
}
+
+ def escapeSpecialChar(str: String): String = {
+ val builder = new StringBuilder
+
+ str.foreach {
+ case '_' => builder ++= "\\_"
+ case '%' => builder ++= "\\%"
+ // TODO Support for escaping more special characters
Review Comment:
I think we should at least also escape `'`, as the generated sql is like `"
LIKE '" + value + "%'";`
--
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]