Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/18451#discussion_r125174262 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala --- @@ -124,6 +126,29 @@ abstract class JdbcDialect extends Serializable { } /** + * Make string literal in SQL valid. + * @param value The string to be escaped. + * @return Escaped string. + */ + @Since("2.3.0") + protected[jdbc] def escapeSql(value: String): String = + if (value == null) null else StringUtils.replace(value, "'", "''") --- End diff -- So far, it only covers single quotes. Actually, this is not complete. We need to improve it in the future PRs. If you have time, feel free to submit PRs.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org