Github user jiangxb1987 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19861#discussion_r154687413
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala ---
@@ -184,9 +188,16 @@ class DataFrameReader private[sql](sparkSession:
SparkSession) extends Logging {
val cls = DataSource.lookupDataSource(source)
if (classOf[DataSourceV2].isAssignableFrom(cls)) {
- val options = new DataSourceV2Options(extraOptions.asJava)
+ val dataSource = cls.newInstance()
+ val options = dataSource match {
+ case cs: ConfigSupport =>
+ val confs = withSessionConfig(cs, sparkSession.sessionState.conf)
+ new DataSourceV2Options((confs ++ extraOptions).asJava)
--- End diff --
Good catch! Should the confs in the `extraOptions` have a higher priority?
WDYT @cloud-fan ?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]