cloud-fan opened a new pull request, #58373:
URL: https://github.com/apache/spark/pull/58373

   ### What changes were proposed in this pull request?
   
   This backports #58204 (`3bc29d9d0ae031dfe0e793886ba652ca98ae7f29`) to 
branch-4.2.
   
   It introduces a temporary binary `UnresolvedInsert` plan for INSERT 
statements whose target uses a
   dynamic `IDENTIFIER(...)` expression. This lets normal analyzer traversal 
resolve parameters,
   functions, and SQL variables in the target before lowering the plan to the 
existing write plan.
   
   For branch-4.2, `INSERT ... REPLACE WHERE` is lowered to that branch's
   `OverwriteByExpression` representation. The transactional regression test is 
also expressed using
   the older transaction test harness. The parse-metadata changes from the 
original commit are omitted
   because the corresponding `ParseSqlResult` and `SqlStatementCodes` 
infrastructure is not present on
   branch-4.2.
   
   ### Why are the changes needed?
   
   `InsertIntoStatement.table` is not a logical-plan child, so analyzer rules 
do not normally visit a
   dynamic target expression stored there. Nested functions, parameters, or SQL 
variables can
   therefore remain unresolved.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. INSERT statements on branch-4.2 can now resolve expressions inside a 
target `IDENTIFIER`
   clause, matching the behavior fixed on master by #58204.
   
   ### How was this patch tested?
   
   The backported parser, analyzer, end-to-end, and transactional-catalog tests 
were included and
   adapted to branch-4.2. The following checks passed locally with Java 17:
   
   ```bash
   build/sbt -java-home /usr/lib/jvm/java-17-openjdk-amd64 \
     catalyst/Test/compile \
     'sql/testOnly org.apache.spark.sql.ParametersSuite' \
     'sql/testOnly org.apache.spark.sql.connector.AppendDataTransactionSuite' \
     pipelines/compile connect/compile
   ```
   
   `ParametersSuite`: 161 tests passed. `AppendDataTransactionSuite`: 18 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]

Reply via email to