-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-25425][SQL] Extra options should override session options in DataSource V2 #22413
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
Changes from all commits
13729b5
14498fb
a443054
48d4cef
83789c6
eba46d9
96990c7
d35d01b
325b9c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -241,10 +241,12 @@ final class DataFrameWriter[T] private[sql](ds: Dataset[T]) { | |
| val source = cls.newInstance().asInstanceOf[DataSourceV2] | ||
| source match { | ||
| case provider: BatchWriteSupportProvider => | ||
| val options = extraOptions ++ | ||
| DataSourceV2Utils.extractSessionConfigs(source, df.sparkSession.sessionState.conf) | ||
| val sessionOptions = DataSourceV2Utils.extractSessionConfigs( | ||
| source, | ||
| df.sparkSession.sessionState.conf) | ||
| val options = sessionOptions ++ extraOptions | ||
|
|
||
| val relation = DataSourceV2Relation.create(source, options.toMap) | ||
| val relation = DataSourceV2Relation.create(source, options) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both read/write-side tests.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 for tests
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wrote a test for read path since I was able to grab options propagated to DataSource but I have no idea so far for write path, only mocking probably. Does it make sense to do that?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For write path, I think we can use the traditional way instead of introducing mocking. Let me try. |
||
| if (mode == SaveMode.Append) { | ||
| runCommand(df.sparkSession, "save") { | ||
| AppendData.byName(relation, df.logicalPlan) | ||
|
|
||
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.
Also, cc @rdblue since this is introduced at aadf953#diff-f70bda59304588cc3abfa3a9840653f4R197 .
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.
@dongjoon-hyun The commit didn't change semantic actually. Before it was:
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.
Oh. It has more history. Thanks, @MaxGekk . Could you trace down when it started? We need to mark the affected version correctly in order to know the backport candidates.
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.
Also, please add a test case for this. If this has a long history than SPARK-23203 (fixed at 2.4.0), we need to verify this during backporting.
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.
The changes were added in #19861
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. Then, it was 2.3.0.