anishshri-db commented on code in PR #56153:
URL: https://github.com/apache/spark/pull/56153#discussion_r3313735178


##########
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))

Review Comment:
   Can we also add a test to ensure that the query works after the `schema` is 
removed ?



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

Reply via email to