[SPARK-17955][SQL] Make DataFrameReader.jdbc call DataFrameReader.format("jdbc").load#15499
Closed
HyukjinKwon wants to merge 2 commits intoapache:masterfrom
Closed
[SPARK-17955][SQL] Make DataFrameReader.jdbc call DataFrameReader.format("jdbc").load#15499HyukjinKwon wants to merge 2 commits intoapache:masterfrom
HyukjinKwon wants to merge 2 commits intoapache:masterfrom
Conversation
|
Test build #67011 has finished for PR 15499 at commit
|
Contributor
|
Merging in master. Thanks. |
robert3005
pushed a commit
to palantir/spark
that referenced
this pull request
Nov 1, 2016
…mat("jdbc").load
## What changes were proposed in this pull request?
This PR proposes to make `DataFrameReader.jdbc` call `DataFrameReader.format("jdbc").load` consistently with other APIs in `DataFrameReader`/`DataFrameWriter` and avoid calling `sparkSession.baseRelationToDataFrame(..)` here and there.
The changes were mostly copied from `DataFrameWriter.jdbc()` which was recently updated.
```diff
- val params = extraOptions.toMap ++ connectionProperties.asScala.toMap
- val options = new JDBCOptions(url, table, params)
- val relation = JDBCRelation(parts, options)(sparkSession)
- sparkSession.baseRelationToDataFrame(relation)
+ this.extraOptions = this.extraOptions ++ connectionProperties.asScala
+ // explicit url and dbtable should override all
+ this.extraOptions += ("url" -> url, "dbtable" -> table)
+ format("jdbc").load()
```
## How was this patch tested?
Existing tests should cover this.
Author: hyukjinkwon <gurwls223@gmail.com>
Closes apache#15499 from HyukjinKwon/SPARK-17955.
gatorsmile
reviewed
Nov 21, 2016
| // connectionProperties should override settings in extraOptions. | ||
| val params = extraOptions.toMap ++ connectionProperties.asScala.toMap | ||
| val options = new JDBCOptions(url, table, params) | ||
| val relation = JDBCRelation(parts, options)(sparkSession) |
Member
There was a problem hiding this comment.
After this change, we lost the feature for parallel JDBC reading, right?
Member
Author
There was a problem hiding this comment.
I see. I thought this was all handled in
Would this be possible to adding those into options rather than reverting this?
Member
There was a problem hiding this comment.
We are using a different mechanism for table partitioning. More flexible. Users can do more advanced partitioning (e.g., using multiple columns) here.
Member
Author
There was a problem hiding this comment.
I see. I am sorry it seems a careless mistake.
This was referenced Nov 21, 2016
uzadude
pushed a commit
to uzadude/spark
that referenced
this pull request
Jan 27, 2017
…mat("jdbc").load
## What changes were proposed in this pull request?
This PR proposes to make `DataFrameReader.jdbc` call `DataFrameReader.format("jdbc").load` consistently with other APIs in `DataFrameReader`/`DataFrameWriter` and avoid calling `sparkSession.baseRelationToDataFrame(..)` here and there.
The changes were mostly copied from `DataFrameWriter.jdbc()` which was recently updated.
```diff
- val params = extraOptions.toMap ++ connectionProperties.asScala.toMap
- val options = new JDBCOptions(url, table, params)
- val relation = JDBCRelation(parts, options)(sparkSession)
- sparkSession.baseRelationToDataFrame(relation)
+ this.extraOptions = this.extraOptions ++ connectionProperties.asScala
+ // explicit url and dbtable should override all
+ this.extraOptions += ("url" -> url, "dbtable" -> table)
+ format("jdbc").load()
```
## How was this patch tested?
Existing tests should cover this.
Author: hyukjinkwon <gurwls223@gmail.com>
Closes apache#15499 from HyukjinKwon/SPARK-17955.
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?
This PR proposes to make
DataFrameReader.jdbccallDataFrameReader.format("jdbc").loadconsistently with other APIs inDataFrameReader/DataFrameWriterand avoid callingsparkSession.baseRelationToDataFrame(..)here and there.The changes were mostly copied from
DataFrameWriter.jdbc()which was recently updated.How was this patch tested?
Existing tests should cover this.