hubgeter opened a new pull request, #71352:
URL: https://github.com/apache/doris/pull/71352

   ### Background
   
   The connector SPI returns stored SQL and a declared view schema together. 
Nereids exposes the analyzed view through `LogicalView`, which also provides 
the boundary used by row filters and column masks.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #70370 (same-catalog default namespace and split plan)
   PR Type: Bugfix
   
   Problem Summary:
   
   An Iceberg view can expose columns `(a, b)` backed by the same source 
expression `x`. Doris previously inherited names and expression IDs from the 
view body, so `SELECT a, b` could fail to bind. Bind outputs to the declared 
schema within the existing view boundary.
   
   ### Details
   
   - **Change map:** 80 lines of FE binding and wrapper code and 234 lines of 
unit and Spark/REST test code.
   - **Frequency:** Affected when a connector view declares names different 
from the body outputs, particularly when one source expression is exposed in 
multiple positions.
   - **Root cause:** `LogicalView` inherited the child slots' names and 
identities. A declared column attached as metadata did not rename the slot or 
give repeated positions their own identity.
   - **Why existing tests missed it:** The previous view suites did not bind 
separately named copies of the same expression or test a column mask and row 
filter on distinct declared positions. The new FE tests cover both, plus stale 
wildcard projections.
   - **Fix:** Convert the schema from the same connector definition as the SQL. 
Validate the output count, and put independent aliases inside the view. Reject 
incompatible wildcard expansions before applying positional names.
   - **Other paths and branches:** Applies to connectors that supply declared 
columns. Views with no declared columns use the existing path. #70370 covers 
saved default databases. Explicit SHOW listing is the third split. Release 
branches were not verified.
   - **Behavior change:** View expressions are exposed under declared names. An 
incompatible wildcard output raises an analysis error before it can be 
mislabeled.
   
   ### Testing
   
   - Checkstyle 9.3, both connector architecture checks, the diff check, and 
Groovy syntax parsing passed. Targeted FE unit execution stops when `protoc` is 
unavailable. The Spark/REST regression compares the two engines using the 
standard external Iceberg configuration and is pending.
   
   ### Release note
   
   Connector views expose their declared output names. Doris reports an 
analysis error when a wildcard view's analyzed output conflicts with its 
declared columns.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes (see Details)
   - Does this need documentation: No
   - Pre-submission status: Partially verified: FE unit execution and 
Spark/REST runtime regression pending.
   
   ### AI Disclosure
   
   - Tool: Codex.
   - Generated: Code, tests and description.
   - Human review: Not stated.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to