[ 
https://issues.apache.org/jira/browse/IMPALA-12588?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17921420#comment-17921420
 ] 

Noemi Pap-Takacs commented on IMPALA-12588:
-------------------------------------------

Kudu tables also use the UpdateStmt. It might be useful to add the extra 
predicates to both Iceberg and Kudu queries.

Also, when rewriting the assignments to form extra predicates, we have to 
consider that NULL (unknown)  values are special:
 * both k=3 and k!=3 evaluates to FALSE if k is NULL
 * *set k = NULL* should be transformed to *k is not NULL*

> Don't update rows that already have the desired value
> -----------------------------------------------------
>
>                 Key: IMPALA-12588
>                 URL: https://issues.apache.org/jira/browse/IMPALA-12588
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>            Reporter: Zoltán Borók-Nagy
>            Assignee: Noemi Pap-Takacs
>            Priority: Major
>              Labels: impala-iceberg
>
> When UPDATEing an Iceberg table, we should write as few new data records and 
> delete records as possible.
> Therefore, if rows already have the new values we should just ignore them.
> One way to achieve this is to add extra predicates, e.g.:
> {noformat}
>   UPDATE tbl SET k = 3 WHERE i > 4;
>     ==>
>   UPDATE tbl SET k = 3 WHERE i > 4 AND k != 3;
> {noformat}
> So we won't write new data/delete records for the rows that already have the 
> desired value.
> For some cases in can be trickier (e.g. UPDATE FROM), those cases could be 
> handled more easily by the new MERGE statement when we have it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to