Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
CREATE OR REPLACE VIEW v AS SELECT * FROM vcan analyze the old definition and then persist a recursive Paimon view. Reading the stored definition subsequently recurses untilStackOverflowError.Validate the original SQL before replacing metadata, preserving the existing definition when a cycle is found. Also reject legacy persisted cycles during resolution and report their dependency path. Paimon expands views without retaining Spark's logical
Viewnodes, so the checker follows stored SQL dependencies, including nested subqueries and CTEs, and respects catalog identifier case sensitivity.The guard points follow Spark's ViewHelper and ViewResolution. A separate internal checker enforces
spark.sql.view.maxNestedViewDepthand reuses validated subtree depths only within one resolver traversal. This avoids repeatedly scanning a nested view chain while still checking shared dependencies reached through deeper paths.Tests
PaimonViewTest: 20 tests passed on each of Spark 3.5 / Java 8, Spark 4.0 / Java 17, and Spark 4.1 / Java 17.