amogh-jahagirdar commented on code in PR #9834:
URL: https://github.com/apache/iceberg/pull/9834#discussion_r1519977773


##########
spark/v3.5/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckViews.scala:
##########
@@ -63,4 +72,29 @@ object CheckViews extends (LogicalPlan => Unit) {
       }
     }
   }
+
+  private def checkCyclicViewReference(
+    viewIdent: Seq[String],
+    plan: LogicalPlan): Unit = {
+    plan match {
+      case sub@SubqueryAlias(_, Project(_, _)) =>
+        val ident: Seq[String] = sub.identifier.qualifier :+ 
sub.identifier.name
+        if (ident == viewIdent) {
+          throw new AnalysisException(String.format("Recursive cycle in view 
detected: %s", viewIdent.asIdentifier))

Review Comment:
   Do you mean it includes the whole cycle path? If so I think that would be 
useful for someone trying to debug why this error is happening. Basically as we 
recurse on the cycle check, we can keep track of the path of identifiers seen 
by appending the identifier that's being visited currently.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to