-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-25425][SQL][BACKPORT-2.3] Extra options should override session options in DataSource V2 #22489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ataSource V2
In the PR, I propose overriding session options by extra options in DataSource V2. Extra options are more specific and set via `.option()`, and should overwrite more generic session options. Entries from seconds map overwrites entries with the same key from the first map, for example:
```Scala
scala> Map("option" -> false) ++ Map("option" -> true)
res0: scala.collection.immutable.Map[String,Boolean] = Map(option -> true)
```
Added a test for checking which option is propagated to a data source in `load()`.
Closes apache#22413 from MaxGekk/session-options.
Lead-authored-by: Maxim Gekk <[email protected]>
Co-authored-by: Dongjoon Hyun <[email protected]>
Co-authored-by: Maxim Gekk <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
|
@dongjoon-hyun Please, take a look at this PR. This is the backport of #22413 to Spark 2.3. |
|
Test build #96341 has finished for PR 22489 at commit
|
|
@dongjoon-hyun @gatorsmile Can the fix be included into the upcoming minor release of 2.3? |
|
I've considered this for 2.3.3 since 2.3.2 RC6 vote was already started. For now, I'm waiting for the result of vote. |
|
Retest this please. |
|
Test build #96592 has finished for PR 22489 at commit
|
| } | ||
|
|
||
| override def createReader(options: DataSourceOptions): DataSourceReader = new Reader | ||
| case class SimpleDataSourceV2Reader(options: DataSourceOptions) extends DataSourceReader { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this non-trivial backporting, @MaxGekk !
|
+1, LGTM. Merged to |
…n options in DataSource V2 ## What changes were proposed in this pull request? In the PR, I propose overriding session options by extra options in DataSource V2. Extra options are more specific and set via `.option()`, and should overwrite more generic session options. ## How was this patch tested? Added tests for read and write paths. Closes #22489 from MaxGekk/session-options-2.3. Authored-by: Maxim Gekk <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
|
Thank you, @MaxGekk . Since this lands on |
What changes were proposed in this pull request?
In the PR, I propose overriding session options by extra options in DataSource V2. Extra options are more specific and set via
.option(), and should overwrite more generic session options.How was this patch tested?
Added tests for read and write paths.