cloud-fan commented on code in PR #46707:
URL: https://github.com/apache/spark/pull/46707#discussion_r1628746131
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala:
##########
@@ -3488,6 +3488,35 @@ class DataSourceV2SQLSuiteV1Filter
}
}
+ test("SPARK-36680: Supports Dynamic Table Options for Spark SQL") {
+ val t1 = s"${catalogAndNamespace}table"
+ withTable(t1) {
+ sql(s"CREATE TABLE $t1 (id bigint, data string) USING $v2Format")
+ sql(s"INSERT INTO $t1 VALUES (1, 'a'), (2, 'b')")
+
+ var df = sql(s"SELECT * FROM $t1")
+ var collected = df.queryExecution.optimizedPlan.collect {
+ case scan: DataSourceV2ScanRelation =>
+ assert(scan.relation.options.isEmpty)
+ }
+ assert (collected.size == 1)
+ checkAnswer(df, Seq(Row(1, "a"), Row(2, "b")))
+
+ df = sql(s"SELECT * FROM $t1 WITH (`split-size` = 5)")
Review Comment:
ok how about we add a TVF like syntax but it's not actual TVF, so that we
can do `FROM BATCH(tbl, k1 => v1, ...)`, and `FROM STREAM(tbl, k1 => v1, ...)`.
It's not actual TVF because the first parameter is table identifier, but we can
make it a valid TVF with `FROM BATCH(TABLE tbl, k1 => v1, ...)`, which is more
verbose.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]