cloud-fan opened a new pull request, #58378:
URL: https://github.com/apache/spark/pull/58378
### What changes were proposed in this pull request?
This follow-up to #58204 makes two corrections:
* Distinguish INSERT targets from other target-table references in
`parse_sql` lineage collection.
INSERT targets continue to bypass CTE shadow filtering, while DELETE,
UPDATE, and MERGE targets
follow CTE substitution semantics.
* Run the early dynamic INSERT target-resolution pass inside the analysis
planning tracker and
report failures through `QueryPlanningTracker.setAnalysisFailed`.
Focused regression tests cover CTE-shadowed DML targets, rule timing for
dynamic INSERT target
resolution, and failure callback reporting.
### Why are the changes needed?
The target-role exemption added by #58204 was broader than required. A
CTE-shadowed DELETE,
UPDATE, or MERGE target could be reported as a catalog target even though
CTE substitution replaces
that relation. Only INSERT targets are deliberately protected from CTE
substitution.
In addition, transaction discovery resolves a dynamic INSERT target before
the normal analysis
phase. That work was absent from rule and phase timing, and an exception
from the pre-pass occurred
before the normal analysis failure callback.
### Does this PR introduce _any_ user-facing change?
Yes, within unreleased master only. `parse_sql` no longer reports
CTE-shadowed DELETE, UPDATE, or
MERGE targets as catalog target-table references. INSERT target reporting is
unchanged.
### How was this patch tested?
Added regression coverage and ran:
```bash
build/sbt "sql/testOnly
org.apache.spark.sql.catalyst.parser.ParseSqlResultSuite
org.apache.spark.sql.execution.QueryExecutionSuite"
```
All 39 tests passed.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5)
--
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]