yadavay-amzn opened a new pull request, #55858: URL: https://github.com/apache/spark/pull/55858
### What changes were proposed in this pull request? Have `ReplaceData` and `WriteDelta` extend `SupportsNonDeterministicExpression` with `allowNonDeterministicExpression = true`. ### Why are the changes needed? MERGE INTO queries fail with `INVALID_NON_DETERMINISTIC_EXPRESSIONS` when the source plan contains non-deterministic expressions (e.g. `uuid()`, `current_timestamp()`, `input_file_name()`). This is a regression from Spark 3.3 introduced when `RewriteMergeIntoTable` moved into core in 3.5. The root cause is that `ReplaceData` (copy-on-write) and `WriteDelta` (merge-on-read) do not implement `SupportsNonDeterministicExpression`, so `CheckAnalysis` rejects them. SPARK-48871 introduced this trait for exactly this class of problem. ### Does this PR introduce _any_ user-facing change? Yes. MERGE INTO with non-deterministic source plans on DSv2 tables (e.g. Iceberg) will no longer fail. ### How was this patch tested? Added test in `AnalysisErrorSuite` verifying both classes implement the trait. ### Was this patch authored or co-authored using generative AI tooling? Yes -- 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]
