Github user frreiss commented on a diff in the pull request:
https://github.com/apache/spark/pull/14691#discussion_r76505064
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamWriter.scala
---
@@ -123,12 +124,30 @@ final class DataStreamWriter[T] private[sql](ds:
Dataset[T]) {
/**
* :: Experimental ::
* Specifies the underlying output data source. Built-in options include
"parquet", "json", etc.
+ * Additionally user specific StreamSinkProviders can be specified hear
using the fully qualified
+ * class name.
*
* @since 2.0.0
*/
@Experimental
def format(source: String): DataStreamWriter[T] = {
this.source = source
+ this.sinkProvider = null
+ this
+ }
+
+ /**
+ * :: Experimental ::
+ * Specifies the underlying output data source using a
StreamSinkProvider. This is useful for
+ * sinks which are constructed with user specified functions (such as a
user specified version of
+ * ForeachSink).
+ *
+ * @since 2.1.0
+ */
+ @Experimental
+ def format(sinkProvider: StreamSinkProvider): DataStreamWriter[T] = {
+ this.source = null
--- End diff --
Probably better to set `source` to a dedicated constant string like
"custom" here, so that the branches in start() all have consistent logic.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]