cloud-fan commented on code in PR #46437: URL: https://github.com/apache/spark/pull/46437#discussion_r1596314679
########## sql/catalyst/src/main/java/org/apache/spark/sql/connector/util/V2ExpressionSQLBuilder.java: ########## @@ -65,7 +68,6 @@ protected String escapeSpecialCharsForLikePattern(String str) { switch (c) { case '_' -> builder.append("\\_"); case '%' -> builder.append("\\%"); - case '\'' -> builder.append("\\\'"); Review Comment: The input of `escapeSpecialCharsForLikePattern` is already a valid SQL string literal (produced by `visitLiteral`), so the `'` is already escaped. ``` private[jdbc] class JDBCSQLBuilder extends V2ExpressionSQLBuilder { override def visitLiteral(literal: Literal[_]): String = { Option(literal.value()).map(v => compileValue(CatalystTypeConverters.convertToScala(v, literal.dataType())).toString) .getOrElse(super.visitLiteral(literal)) } ``` -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org