You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zikangh (via GitHub)" <gi...@apache.org> on 2026/05/27 20:32:21 UTC

Re: [PR] [SPARK-56975][SS][FOLLOWUP] Gate user-specified schema rejection behind a config [spark]

zikangh commented on code in PR #56153:
URL: https://github.com/apache/spark/pull/56153#discussion_r3313597987


##########
sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamTableAPISuite.scala:
##########
@@ -94,8 +94,27 @@ class DataStreamTableAPISuite extends StreamTest with BeforeAndAfter {
       }
       checkError(
         exception = e,
-        condition = "_LEGACY_ERROR_TEMP_1189",
-        parameters = Map("operation" -> "table"))
+        condition = "STREAMING_USER_SPECIFIED_SCHEMA_NOT_ALLOWED_IN_TABLE",
+        parameters = Map(
+          "config" ->
+            SQLConf.STREAMING_DISALLOW_USER_SPECIFIED_SCHEMA_IN_TABLE_ENABLED.key))
+    }
+  }
+
+  test("read: user-specified schema is silently ignored when flag is flipped off") {
+    val tblName = "my_table"
+    withTable(tblName) {
+      spark.range(3).write.format("parquet").saveAsTable(tblName)
+      withSQLConf(
+          SQLConf.STREAMING_DISALLOW_USER_SPECIFIED_SCHEMA_IN_TABLE_ENABLED.key -> "false") {
+        testStream(
+            spark.readStream
+              .schema(new StructType().add("a", IntegerType))
+              .table(tblName))(
+          ProcessAllAvailable(),
+          CheckAnswer(Row(0), Row(1), Row(2))

Review Comment:
   Could you check that the table schema is used? 



-- 
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-unsubscribe@spark.apache.org

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


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