Skip to content

Conversation

@nastra
Copy link
Contributor

@nastra nastra commented Feb 29, 2024

No description provided.

@github-actions github-actions bot added the spark label Feb 29, 2024
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))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also consider including the actual cycle in the error msg. Spark's error msg for V1 views is [RECURSIVE_VIEW] Recursive view spark_catalog.default.view_one754453detected (cycle:spark_catalog.default.view_one754453->spark_catalog.default.view_one754453).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amogh-jahagirdar I've added the cycle to the error msg in the last commit. Can you take another look please?

@nastra nastra force-pushed the spark-view-cycle-detection branch from 5ad411e to ca48b37 Compare March 8, 2024 13:03
@nastra nastra force-pushed the spark-view-cycle-detection branch from ca48b37 to 173e857 Compare March 26, 2024 11:31
@nastra nastra requested a review from amogh-jahagirdar March 26, 2024 11:33
@nastra
Copy link
Contributor Author

nastra commented Mar 26, 2024

CI failure is known and related to #10038

Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this, this looks good to me!

@amogh-jahagirdar amogh-jahagirdar merged commit 4579b7a into apache:main Mar 27, 2024
@nastra nastra deleted the spark-view-cycle-detection branch March 27, 2024 07:26
sasankpagolu pushed a commit to sasankpagolu/iceberg that referenced this pull request Oct 27, 2024
@nastra nastra self-assigned this Nov 25, 2024
zachdisc pushed a commit to zachdisc/iceberg that referenced this pull request Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants