forked from databendlabs/databend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support explain fragments for update (databendlabs#14227)
* feat: support explain fragments for update * fix * fix * fix * fix
- Loading branch information
1 parent
bac11aa
commit 3759207
Showing
3 changed files
with
118 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
statement ok | ||
DROP DATABASE IF EXISTS db1 | ||
|
||
statement ok | ||
CREATE DATABASE db1 | ||
|
||
statement ok | ||
USE db1 | ||
|
||
statement ok | ||
CREATE TABLE IF NOT EXISTS t1(a Int, b Date) | ||
|
||
statement ok | ||
INSERT INTO t1 VALUES(1, '2022-12-30') | ||
|
||
statement ok | ||
INSERT INTO t1 VALUES(2, '2023-01-01') | ||
|
||
query IT | ||
SELECT * FROM t1 ORDER BY b | ||
---- | ||
1 2022-12-30 | ||
2 2023-01-01 | ||
|
||
query T | ||
explain fragments UPDATE t1 SET a = 3 WHERE b > '2022-12-31' | ||
---- | ||
Fragment 0: | ||
DataExchange: Merge | ||
ExchangeSink | ||
├── output columns: [] | ||
├── destination fragment: [1] | ||
└── UpdateSource | ||
(empty) | ||
(empty) | ||
Fragment 1: | ||
CommitSink | ||
└── ExchangeSource | ||
├── output columns: [] | ||
└── source fragment: [0] | ||
(empty) | ||
|
||
query IT | ||
SELECT * FROM t1 ORDER BY b | ||
---- | ||
1 2022-12-30 | ||
2 2023-01-01 | ||
|
||
query T | ||
explain fragments UPDATE t1 SET a = 3 WHERE false | ||
---- | ||
Nothing to update | ||
|
||
|