[GitHub] [spark] zhenlineo commented on a diff in pull request #40498: [WIP] reader table API could also accept options

2023-03-20 Thread via GitHub


zhenlineo commented on code in PR #40498:
URL: https://github.com/apache/spark/pull/40498#discussion_r1142775827


##
connector/connect/common/src/main/protobuf/spark/connect/relations.proto:
##
@@ -148,6 +143,13 @@ message Read {
 // This is only supported by the JDBC data source.
 repeated string predicates = 5;
   }
+
+  // Options for data sources and named table.
+  //
+  // When using for data sources, the context of this map varies based on the
+  // data source format. This options could be empty for valid data source 
format.
+  // The map key is case insensitive.
+  map options = 3;

Review Comment:
   What's the policy around "breaking changes"?



-- 
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.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] zhenlineo commented on a diff in pull request #40498: [WIP] reader table API could also accept options

2023-03-20 Thread via GitHub


zhenlineo commented on code in PR #40498:
URL: https://github.com/apache/spark/pull/40498#discussion_r1142775413


##
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/DataFrameReader.scala:
##
@@ -183,7 +183,7 @@ class DataFrameReader private[sql] (sparkSession: 
SparkSession) extends Logging
   dataSourceBuilder.setFormat(source)
   userSpecifiedSchema.foreach(schema => 
dataSourceBuilder.setSchema(schema.toDDL))
   extraOptions.foreach { case (k, v) =>
-dataSourceBuilder.putOptions(k, v)
+builder.getReadBuilder.putOptions(k, v)

Review Comment:
   +1
   Can you also add a simple test `reader.options().table()`?



-- 
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.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org