sryza commented on code in PR #51644:
URL: https://github.com/apache/spark/pull/51644#discussion_r2382985709
##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/graph/GraphRegistrationContext.scala:
##########
@@ -45,17 +49,20 @@ class GraphRegistrationContext(
views += viewDef
}
+ def registerSink(sinkDef: Sink): Unit = {
+ sinks += sinkDef
+ }
+
def registerFlow(flowDef: UnresolvedFlow): Unit = {
flows += flowDef.copy(sqlConf = defaultSqlConf ++ flowDef.sqlConf)
}
def toDataflowGraph: DataflowGraph = {
- if (tables.isEmpty && views.collect { case v: PersistedView =>
- v
- }.isEmpty) {
- throw new AnalysisException(
- errorClass = "RUN_EMPTY_PIPELINE",
- messageParameters = Map.empty)
+ if (tables.isEmpty && views.collect {
+ case v: PersistedView =>
+ v
+ }.isEmpty && sinks.isEmpty) {
Review Comment:
Do you know whether a pipeline with a table but not flows targeting it is a
valid pipeline? I would expect the same behavior for sinks. I.e.
- 1 sink + 1 flow -> valid
- 1 sink + 0 flows -> not sure
--
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]