cloud-fan commented on a change in pull request #29535:
URL: https://github.com/apache/spark/pull/29535#discussion_r477045489



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala
##########
@@ -822,6 +821,8 @@ class DataFrameReader private[sql](sparkSession: 
SparkSession) extends Logging {
    */
   def table(tableName: String): DataFrame = {
     assertNoSpecifiedSchema("table")
+    for ((k, v) <- this.extraOptions)
+      sparkSession.conf.set(k, v)

Review comment:
       1. We don't need to change `SparkSession.table`. We can create 
`UnresolvedRelation` in `DataFrameReader.table` directly.
   2. This is options to scan the v2 table, not v2 table properties. We don't 
need to change `TableCatalog.loadTable`, but pass the scan options to 
`Table.newScanBuilder`. `DataSourceV2Relation` already takes the scan options, 
we just need to create `DataSourceV2Relation` with scan options in 
`ResolveTables` and `ResolveRelations`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to