HeartSaVioR commented on a change in pull request #30521:
URL: https://github.com/apache/spark/pull/30521#discussion_r533043551
##########
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:
Again I don't just say about the name. I say about the usage pattern -
at least for DataStreamWriter, for years `start()` is the only trigger entry
starting the query. Isn't it enough reason to have DataStreamWriterV2 for
breaking the pattern? Once we have `df.writeStreamTo("table")` everything is in
sync with DataFrameWriterV2 (`df.writeTo("table")`) and no confusion.
If we really insist to have two different trigger entries I'm OK to go with
`toTable` but not just simply `table`, because it doesn't say intuitively that
the method is a terminal operation. We'll have to rely on return type to see
whether it's returning StreamingQuery instance - JVM languages will get blessed
by IDE, but I'm not quite sure IDE won't guide for all supported non-JVM
languages.
----------------------------------------------------------------
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]