szehon-ho commented on code in PR #56042:
URL: https://github.com/apache/spark/pull/56042#discussion_r3291326185


##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/graph/GraphValidations.scala:
##########
@@ -58,6 +76,13 @@ trait GraphValidations extends Logging {
     multiQueryTables
   }
 
+  /** Returns true iff the given flow is an [[AutoCdcFlow]] (resolved or not). 
*/
+  private def isAutoCdcFlow(f: Flow): Boolean = f match {

Review Comment:
   The current logic works because `AutoCdcMergeFlow` extends 
`ResolutionCompletedFlow` and `rcf.flow` is an `AutoCdcFlow`. For readability, 
consider making the resolved case explicit:
   
   ```scala
   private def isAutoCdcFlow(f: Flow): Boolean = f match {
     case _: AutoCdcFlow | _: AutoCdcMergeFlow => true
     case rcf: ResolutionCompletedFlow => rcf.flow.isInstanceOf[AutoCdcFlow]
     case _ => false
   }
   ```
   
   Or, if you only ever see unresolved `AutoCdcFlow` and resolved 
`AutoCdcMergeFlow` in `flowsTo`, the middle case might be redundant—worth a 
quick comment on which shapes appear at validation time.



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

Reply via email to