ueshin commented on code in PR #40000:
URL: https://github.com/apache/spark/pull/40000#discussion_r1105114706


##########
python/pyspark/sql/readwriter.py:
##########
@@ -468,7 +468,7 @@ def table(self, tableName: str) -> "DataFrame":
         |  8|
         |  9|
         +---+
-        >>> _ = spark.sql("DROP TABLE tblA")
+        >>> _ = spark.sql("DROP TABLE tblA").collect()

Review Comment:
   For [SPARK-41725](https://issues.apache.org/jira/browse/SPARK-41725).



##########
python/pyspark/sql/connect/readwriter.py:
##########
@@ -472,6 +472,8 @@ def save(
     def insertInto(self, tableName: str, overwrite: Optional[bool] = None) -> 
None:
         if overwrite is not None:
             self.mode("overwrite" if overwrite else "append")
+        elif self._write.mode is None or self._write.mode != "overwrite":
+            self.mode("append")
         self.saveAsTable(tableName)

Review Comment:
   I guess we shouldn't reuse this for `insertInto`? Should revisit this.



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