yihua opened a new issue, #20856:
URL: https://github.com/apache/hudi/issues/20856

   On a merge-on-read table, a Spark SQL `MERGE INTO` whose `WHEN MATCHED` 
condition refers to a target column reports success and changes nothing.
   
   The command writes the source rows and the append handle evaluates the 
matched clauses on the source row alone, so a condition such as `when matched 
and t.price < 15 then update set *` reads past the end of the source row. The 
append handle catches the resulting `ArrayIndexOutOfBoundsException` per record 
(`hoodie.write.ignore.failed` defaults to true), so the delta commit completes 
without the update or delete. The clause only takes effect in file groups that 
also took inserts of the statement, since those go through a merge with the 
target rows, so the outcome depends on where unmatched source rows land. A 
target column in an assigned value (`set price = t.price + s.price`) is refused 
outright on merge-on-read tables, although copy-on-write tables support it.
   
   Proposal: for a table with a record key, when a matched clause refers to 
target columns, merge the located records with the rows they match right after 
the index lookup and append the full result rows to the log. A table without a 
record key should refuse such a condition at analysis instead of silently 
dropping it.
   


-- 
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]

Reply via email to