-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-32844][SQL] Make DataFrameReader.table
take the specified options for datasource v1
#29712
Conversation
DataFrameReader.table
take the specified options for datasource v1DataFrameReader.table
take the specified options for datasource v1
cc @cloud-fan |
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceUtils.scala
Outdated
Show resolved
Hide resolved
@@ -251,24 +255,25 @@ class FindDataSourceTable(sparkSession: SparkSession) extends Rule[LogicalPlan] | |||
partitionColumns = table.partitionColumnNames, | |||
bucketSpec = table.bucketSpec, | |||
className = table.provider.get, | |||
options = table.storage.properties ++ pathOption, | |||
options = extraOptions.asCaseSensitiveMap.asScala.toMap | |||
++ table.storage.properties ++ pathOption, |
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.
nit: let's say table properties have key=1
, and extraOptions
have KEY=1
. The check can pass, but the final options have both key
and KEY
. We should avoid it and keeping key
from table properties.
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.
Thanks, done in cc250b9.
Test build #128511 has finished for PR 29712 at commit
|
Test build #128518 has finished for PR 29712 at commit
|
@@ -190,4 +192,15 @@ object DataSourceUtils { | |||
case LegacyBehaviorPolicy.LEGACY => RebaseDateTime.rebaseGregorianToJulianMicros | |||
case LegacyBehaviorPolicy.CORRECTED => identity[Long] | |||
} | |||
|
|||
private[sql] def checkDuplicateOptions( |
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.
We can remove private[sql]
since execution package is already private (SPARK-16964)
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.
Ah yeah, thanks for reminding, done in cc250b9.
sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceUtils.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceUtils.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceUtils.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceUtils.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceUtils.scala
Outdated
Show resolved
Hide resolved
Test build #128564 has finished for PR 29712 at commit
|
Test build #128565 has finished for PR 29712 at commit
|
05aa245
to
f3f8c8d
Compare
Test build #128579 has finished for PR 29712 at commit
|
thanks, merging to master! |
Thanks for the review. |
…ation ### What changes were proposed in this pull request? This PR fixes the 'options' description on `UnresolvedRelation`. This comment was added in #29535 but not valid anymore because V1 also uses this `options` (and merge the options with the table properties) per #29712. This PR can go through from `master` to `branch-3.1`. ### Why are the changes needed? To make `UnresolvedRelation.options`'s description clearer. ### Does this PR introduce _any_ user-facing change? No, dev-only. ### How was this patch tested? Scala linter by `dev/linter-scala`. Closes #34075 from HyukjinKwon/minor-comment-unresolved-releation. Authored-by: Hyukjin Kwon <gurwls223@apache.org> Signed-off-by: Huaxin Gao <huaxin_gao@apple.com>
…ation ### What changes were proposed in this pull request? This PR fixes the 'options' description on `UnresolvedRelation`. This comment was added in #29535 but not valid anymore because V1 also uses this `options` (and merge the options with the table properties) per #29712. This PR can go through from `master` to `branch-3.1`. ### Why are the changes needed? To make `UnresolvedRelation.options`'s description clearer. ### Does this PR introduce _any_ user-facing change? No, dev-only. ### How was this patch tested? Scala linter by `dev/linter-scala`. Closes #34075 from HyukjinKwon/minor-comment-unresolved-releation. Authored-by: Hyukjin Kwon <gurwls223@apache.org> Signed-off-by: Huaxin Gao <huaxin_gao@apple.com> (cherry picked from commit 0076eba) Signed-off-by: Huaxin Gao <huaxin_gao@apple.com>
…ation ### What changes were proposed in this pull request? This PR fixes the 'options' description on `UnresolvedRelation`. This comment was added in #29535 but not valid anymore because V1 also uses this `options` (and merge the options with the table properties) per #29712. This PR can go through from `master` to `branch-3.1`. ### Why are the changes needed? To make `UnresolvedRelation.options`'s description clearer. ### Does this PR introduce _any_ user-facing change? No, dev-only. ### How was this patch tested? Scala linter by `dev/linter-scala`. Closes #34075 from HyukjinKwon/minor-comment-unresolved-releation. Authored-by: Hyukjin Kwon <gurwls223@apache.org> Signed-off-by: Huaxin Gao <huaxin_gao@apple.com> (cherry picked from commit 0076eba) Signed-off-by: Huaxin Gao <huaxin_gao@apple.com>
What changes were proposed in this pull request?
Make
DataFrameReader.table
take the specified options for datasource v1.Why are the changes needed?
Keep the same behavior of v1/v2 datasource, the v2 fix has been done in SPARK-32592.
Does this PR introduce any user-facing change?
Yes. The DataFrameReader.table will take the specified options. Also, if there are the same key and value exists in specified options and table properties, an exception will be thrown.
How was this patch tested?
New UT added.