← Back to Pull requests

[spark] Resolve the tables of a Paimon view in the namespace of the view #11462

Open
unknown opened this pull request with 236 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 25, 2026 13:24 UTC
Author

Purpose

close #11461

Paimon view bodies resolved in the reader's namespace: USE db1; CREATE VIEW v AS SELECT FROM orders; USE db2; SELECT FROM db1.v read db2.orders.

CREATE VIEW stores the property spark.view.resolve-in-view-namespace = true unless set. Then PaimonViewRelations.qualify adds the view's catalog and namespace to one-part names, and its catalog to other names without one. As in Spark's persistent views, temporary views are not read; CREATE VIEW rejects them. File reads like `parquet.path stay unless a catalog Spark or Paimon looks them up in has them. Older or Flink views resolve as before.

For a body with names resolved later in analysis, CREATE VIEW stores false: a CTE kept by the LEGACY CTE policy, an IDENTIFIER(...) clause the parser does not fold, or the table argument of Paimon's table-valued functions. So does a Spark 3.2 CREATE TEMPORARY VIEW reading a temporary view: Paimon persists it without TBLPROPERTIES.

Tests

In PaimonViewTestBase:

  • "resolve unqualified names in the namespace of the view": a view, a view on a view, a view with an IN subquery and a view created elsewhere, read from another namespace. It fails on master.

  • "views without the namespace option resolve in the current namespace": an older view, then recreated with and without the property.

  • "databases named like data sources resolve in the view catalog": parquet, jdbc, orc tables and a parquet path read from another catalog; after a drop, reads directly and through a temporary view fail.

  • "views resolving in their namespace do not read temporary views": directly, through a temporary view, at CREATE VIEW`, and for Spark 3.2 temporary views.

  • "CTE in a subquery under the LEGACY CTE policy" and "names resolved later in analysis bind in the current namespace": such bodies bind entirely in the current namespace.
  • Diff: 236 lines (+177 / -59) across 2 files Reviewer: LuciferYang Review duration: 5258m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 236 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.327
    Real PR Conversation Timeline
    1 comments
    "Review active on #11462"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.2% (MEDIUM) · Higher = larger blast radius
    37.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.8% · Safe to merge
    19.8%
    Repository