anew commented on code in PR #57245:
URL: https://github.com/apache/spark/pull/57245#discussion_r3591526526
##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/graph/GraphValidations.scala:
##########
@@ -253,7 +253,12 @@ trait GraphValidations extends Logging {
}
protected def validateUserSpecifiedSchemas(): Unit = {
- flows.flatMap(f => table.get(f.identifier)).foreach { t: TableElement =>
+ // Look up the destination table of each flow, not the table matching the
flow's own
+ // identifier. The two coincide only for an implicit/default flow (whose
identifier equals its
+ // destination table's); for a named flow (e.g. `CREATE FLOW <name> AS
AUTO CDC INTO <target>`)
+ // they differ, and keying on the flow identifier would silently skip
validation. `distinct`
+ // collapses the multiple flows that can share a single destination.
+ flows.flatMap(f => table.get(f.destinationIdentifier)).distinct.foreach {
t: TableElement =>
Review Comment:
yes good catch
--
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]