nastra commented on code in PR #9834: URL: https://github.com/apache/iceberg/pull/9834#discussion_r1539052083
########## 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: @amogh-jahagirdar I've added the cycle to the error msg in the last commit. Can you take another look please? -- 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