gatorsmile commented on a change in pull request #29543:
URL: https://github.com/apache/spark/pull/29543#discussion_r485994670
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamReaderWriterSuite.scala
##########
@@ -703,4 +703,53 @@ class DataStreamReaderWriterSuite extends StreamTest with
BeforeAndAfter {
queries.foreach(_.stop())
}
}
+
+ test("SPARK-32516: 'path' cannot coexist with load()'s path parameter") {
+ def verifyLoadFails(f: => DataFrame): Unit = {
+ val e = intercept[AnalysisException](f)
+ assert(e.getMessage.contains(
+ "Either remove the path option, or call load() without the parameter"))
+ }
+
+ verifyLoadFails(spark.readStream.option("path", "tmp1").parquet("tmp2"))
+ verifyLoadFails(spark.readStream.option("path",
"tmp1").format("parquet").load("tmp2"))
+
+ withClue("SPARK-32516: legacy behavior") {
+ withSQLConf(SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key -> "true") {
+ spark.readStream
+ .format("org.apache.spark.sql.streaming.test")
+ .option("path", "tmp1")
+ .load("tmp2")
Review comment:
This could be flaky. The directory of tmp2 could be non-empty and
contains illegal data.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]