[GitHub] spark pull request #19192: Quote table names in JDBC queries
Github user alexmojaki closed the pull request at: https://github.com/apache/spark/pull/19192 --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] spark pull request #19192: Quote table names in JDBC queries
Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/19192#discussion_r138228826 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala --- @@ -100,7 +100,7 @@ abstract class JdbcDialect extends Serializable { * @return The SQL query to use for checking the table. */ def getTableExistsQuery(table: String): String = { -s"SELECT * FROM $table WHERE 1=0" +s"SELECT * FROM ${quoteIdentifier(table)} WHERE 1=0" --- End diff -- This is a behavior change. After we quote the names, the table names become case sensitive in most RDBMS. We need at least a JDBC option to control it. --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] spark pull request #19192: Quote table names in JDBC queries
GitHub user alexmojaki opened a pull request: https://github.com/apache/spark/pull/19192 Quote table names in JDBC queries In MySQL table names sometimes need to be quoted. This should fix that, although I haven't tested (I really don't want to go through the build and everything). Also, four quotes in a row is not readable. You can merge this pull request into a Git repository by running: $ git pull https://github.com/alexmojaki/spark patch-2 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/19192.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #19192 commit 4f3d66ded1007c0ebfc06f5dca18138b7bc3745b Author: Alex HallDate: 2017-09-11T16:08:12Z Quote table names in JDBC queries In MySQL table names sometimes need to be quoted. This should fix that, although I haven't tested. Also, four quotes in a row is not readable. --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org