Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/21379#discussion_r191641304
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRelation.scala
---
@@ -78,7 +79,12 @@ private[sql] object JDBCRelation extends Logging {
// Overflow and silliness can happen if you subtract then divide.
// Here we get a little roundoff, but that's (hopefully) OK.
val stride: Long = upperBound / numPartitions - lowerBound /
numPartitions
- val column = partitioning.column
+ val column = if (jdbcOptions.quotePartitionColumnName) {
+ val dialect = JdbcDialects.get(jdbcOptions.url)
+ dialect.quoteIdentifier(partitioning.column)
--- End diff --
If possible, please do not break the existing behavior. Both should work
without specifying the extra option:
```
val df = spark.read.format("jdbc")
.option("url", urlWithUserAndPass)
.option("dbtable", "TEST.PEOPLE")
.option("partitionColumn", "nonQuotedPrtColName")
.option("lowerBound", 1)
.option("upperBound", 4)
.option("numPartitions", 3)
.load()
```
```
val df = spark.read.format("jdbc")
.option("url", urlWithUserAndPass)
.option("dbtable", "TEST.PEOPLE")
.option("partitionColumn", """"nonQuotedPrtColName"""")
.option("lowerBound", 1)
.option("upperBound", 4)
.option("numPartitions", 3)
.load()
```
Is that possible?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]