yihua opened a new issue, #20841: URL: https://github.com/apache/hudi/issues/20841
Spark SQL UPDATE, DELETE and MERGE INTO on a Hudi table accept conditions that Spark rejects for other tables, and the write then evaluates them in ways the statement does not mean: - A non-deterministic condition (`DELETE FROM t WHERE rand() < 0.5`, or `rand()` in a MERGE ON or WHEN clause) is applied as a filter or inside `ExpressionPayload`, where it can be evaluated more than once for one record. Spark fails these with `INVALID_NON_DETERMINISTIC_EXPRESSIONS`, but Hudi's rule converts the statement into its command before that check runs. - A subquery in a MERGE INTO WHEN condition is serialized into `ExpressionPayload` and fails inside the write with an internal error. - An aggregate in a MERGE INTO WHEN condition is evaluated per record instead of being refused. Proposal: leave statements with non-deterministic conditions to Spark's own analysis check, and refuse subqueries and aggregates in WHEN conditions at analysis with a message that names the clause. -- 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]
