[SPARK-16387][SQL] JDBC Writer should use dialect to quote field names.#14107
Closed
dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
dongjoon-hyun:SPARK-16387
Closed
[SPARK-16387][SQL] JDBC Writer should use dialect to quote field names.#14107dongjoon-hyun wants to merge 1 commit intoapache:masterfrom dongjoon-hyun:SPARK-16387
dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
dongjoon-hyun:SPARK-16387
Conversation
|
Test build #61996 has finished for PR 14107 at commit
|
Contributor
|
Merging in master/2.0. |
asfgit
pushed a commit
that referenced
this pull request
Jul 8, 2016
## What changes were proposed in this pull request?
Currently, JDBC Writer uses dialects to get datatypes, but doesn't to quote field names. This PR uses dialects to quote the field names, too.
**Reported Error Scenario (MySQL case)**
```scala
scala> val url="jdbc:mysql://localhost:3306/temp"
scala> val prop = new java.util.Properties
scala> prop.setProperty("user","root")
scala> spark.createDataset(Seq("a","b","c")).toDF("order")
scala> df.write.mode("overwrite").jdbc(url, "temptable", prop)
...MySQLSyntaxErrorException: ... near 'order TEXT )
```
## How was this patch tested?
Pass the Jenkins tests and manually do the above case.
Author: Dongjoon Hyun <dongjoon@apache.org>
Closes #14107 from dongjoon-hyun/SPARK-16387.
(cherry picked from commit 3b22291)
Signed-off-by: Reynold Xin <rxin@databricks.com>
Member
Author
|
Oh, super fast! Thank you. |
zzcclp
added a commit
to zzcclp/spark
that referenced
this pull request
Jul 13, 2016
… names. apache#14107 without test suite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Currently, JDBC Writer uses dialects to get datatypes, but doesn't to quote field names. This PR uses dialects to quote the field names, too.
Reported Error Scenario (MySQL case)
How was this patch tested?
Pass the Jenkins tests and manually do the above case.