cloud-fan commented on a change in pull request #30521:
URL: https://github.com/apache/spark/pull/30521#discussion_r533449224



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamWriter.scala
##########
@@ -304,46 +308,68 @@ final class DataStreamWriter[T] private[sql](ds: 
Dataset[T]) {
    * @since 3.1.0
    */
   @throws[TimeoutException]
-  def saveAsTable(tableName: String): StreamingQuery = {
-    this.source = SOURCE_NAME_TABLE
+  def table(tableName: String): StreamingQuery = {

Review comment:
       I think having 2 branches is OK in `DataStreamWriter`. The reason to 
have `DataFrameWriterV2` is not that `DataFrameWriter` has multiple branches, 
but because `SaveMode` is a bad API to describe the table write semantic.
   
   About the naming, I don't have a strong preference. `toTable` looks file. 
One drawback is `toTable` doesn't indicate that we will create the table if it 
doesn't exist. `createOrInsertTable` seems more accurate but too long.




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

Reply via email to