-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: change tracking enabled table support replace into #14831
Conversation
for append only stream, the "semantic" appears to be inconsistent: Given table t, insert row
is this intended behavior? |
Yes, it's intended behavior. Here treat the semantics of replace as INSERT and DELETE, not INSERT and UPDATE. Take the following sql as an example. mysql> create table t(a int, b string);
Query OK, 0 rows affected (0.03 sec)
mysql> insert into t values(1,'a'),(1,'b'),(2,'b');
Query OK, 3 rows affected (0.04 sec)
mysql> replace into t on(a) values(1,'a1'),(3,'c');
Query OK, 4 rows affected (0.11 sec)
mysql> select * from t order by a;
+------+------+
| a | b |
+------+------+
| 1 | a1 |
| 2 | b |
| 3 | c |
+------+------+
3 rows in set (0.04 sec)
Read 3 rows, 50.00 B in 0.020 sec., 146.61 rows/sec., 2.39 KiB/sec. We can make a note in the documentation to remind users of this distinction. |
looks reasonable to me, let's roll out. |
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Tests
Type of change
This change is