gengliangwang commented on code in PR #50571: URL: https://github.com/apache/spark/pull/50571#discussion_r2040355842
########## sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala: ########## @@ -1405,6 +1405,31 @@ abstract class DDLSuite extends QueryTest with DDLSuiteBase { } } + test("SPARK-51747: When legacy conf enabled data source read ignores option change") { + withSQLConf(SQLConf.READ_DATA_SOURCE_CACHE_IGNORE_OPTIONS.key -> "true") { + withTable("t") { + spark.sql("CREATE TABLE t(a string, b string) USING CSV".stripMargin) + spark.sql("INSERT INTO TABLE t VALUES ('a;b', 'c')") + spark.sql("INSERT INTO TABLE t VALUES ('hello; world', 'test')") + + // check initial contents of table + checkAnswer(spark.table("t"), Row("a;b", "c") :: Row("hello; world", "test") :: Nil) + + // no option + checkAnswer( + spark.sql("SELECT * FROM t"), + Row("a;b", "c") :: Row("hello; world", "test") :: Nil + ) + + // ignore delimiter option, unlike when legacy conf disabled (the default setting) Review Comment: let's also test `spark.read.option(k, v).table(...)` for both cases -- 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