Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Sep 20, 2018

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.

MaxGekk and others added 4 commits September 19, 2018 22:09
…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]>
@MaxGekk
Copy link
Member Author

MaxGekk commented Sep 20, 2018

@dongjoon-hyun Please, take a look at this PR. This is the backport of #22413 to Spark 2.3.

@SparkQA
Copy link

SparkQA commented Sep 20, 2018

Test build #96341 has finished for PR 22489 at commit f8b5aa6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class SimpleDataSourceV2Reader(options: DataSourceOptions) extends DataSourceReader
  • class SimpleDataSourceV2 extends DataSourceV2 with ReadSupport

@MaxGekk
Copy link
Member Author

MaxGekk commented Sep 21, 2018

@dongjoon-hyun @gatorsmile Can the fix be included into the upcoming minor release of 2.3?

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Sep 23, 2018

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.

@dongjoon-hyun
Copy link
Member

Retest this please.

@SparkQA
Copy link

SparkQA commented Sep 26, 2018

Test build #96592 has finished for PR 22489 at commit f8b5aa6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class SimpleDataSourceV2Reader(options: DataSourceOptions) extends DataSourceReader
  • class SimpleDataSourceV2 extends DataSourceV2 with ReadSupport

}

override def createReader(options: DataSourceOptions): DataSourceReader = new Reader
case class SimpleDataSourceV2Reader(options: DataSourceOptions) extends DataSourceReader {
Copy link
Member

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 !

@dongjoon-hyun
Copy link
Member

+1, LGTM. Merged to branch-2.3.

asfgit pushed a commit that referenced this pull request Sep 26, 2018
…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]>
@dongjoon-hyun
Copy link
Member

Thank you, @MaxGekk . Since this lands on branch-2.3, could you close this PR?

@MaxGekk MaxGekk closed this Sep 26, 2018
@MaxGekk MaxGekk deleted the session-options-2.3 branch August 17, 2019 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants