substrait-io / substrait

A cross platform way to express data transformation, relational algebra, standardized record expression and plans.
https://substrait.io
Apache License 2.0
1.21k stars 160 forks source link

feat: proto change to support WRITE_OP_UPDATE in WriteRel #733

Closed scgkiran closed 2 weeks ago

EpsilonPrime commented 2 weeks ago

It's probably worth looking at the SQL that this is supposed to enable.

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

table_name and the WHERE clause specify what is to be changed (along with the actual values.

The existing behavior is a complete replacement. (Essentially delete all existing rows and add this input.). We should strive to only update the rows that are changing if possible.

jacques-n commented 2 weeks ago

Discussed this some on sync call today. I think there are two different patterns we should support. The current one is good if you assume implicit row ids (a physical concept).

I suggest we introduce a separate relation which maps more logically to sql.

jacques-n commented 2 weeks ago

I'm going to close this PR as probably not the optimal changes.