yyanyy commented on code in PR #57865:
URL: https://github.com/apache/spark/pull/57865#discussion_r3817414007


##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSessionCatalogSuite.scala:
##########
@@ -98,6 +98,25 @@ class DataSourceV2DataFrameSessionCatalogSuite
       verifyTable("t", df)
     }
   }
+
+  test("SPARK-58389: time travel options are ignored for V1 table writes") {
+    withTable("t") {
+      sql("CREATE TABLE t(c BIGINT) USING csv")
+      val df = spark.range(1).toDF("c")
+
+      df.write

Review Comment:
   Thanks for the review! The placement of `verifyTable` made this write look 
unused, but the write does go through the V2 entry point, loads `t` as a 
`V1Table`, and falls back to the V1 `insertInto` path here:
   
   
https://github.com/apache/spark/blob/5009aff212877af88930b6c8f88c79b0e907bb1b/sql/core/src/main/scala/org/apache/spark/sql/classic/DataFrameWriter.scala#L361-L367
   
   It successfully inserts `df`. I made a small readability change by moving 
`verifyTable("t", df)` immediately after this write, so its effect is verified 
before the independent `saveAsTable` case.



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