-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support iceberg sink upsert mode (#12576)
Co-authored-by: ZENOTME <[email protected]>
- Loading branch information
Showing
16 changed files
with
751 additions
and
157 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[default] | ||
result = data.csv | ||
|
||
[spark] | ||
url=sc://localhost:15002 | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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,45 @@ | ||
statement ok | ||
set streaming_parallelism=4; | ||
|
||
statement ok | ||
CREATE TABLE t6 (id int, v1 int primary key, v2 bigint, v3 varchar); | ||
|
||
statement ok | ||
CREATE MATERIALIZED VIEW mv6 AS SELECT * FROM t6; | ||
|
||
statement ok | ||
CREATE SINK s6 AS select mv6.id as id, mv6.v1 as v1, mv6.v2 as v2, mv6.v3 as v3 from mv6 WITH ( | ||
connector = 'iceberg', | ||
type = 'upsert', | ||
force_append_only = 'false', | ||
database.name = 'demo', | ||
table.name = 'demo_db.demo_table', | ||
catalog.type = 'storage', | ||
warehouse.path = 's3://icebergdata/demo', | ||
s3.endpoint = 'http://127.0.0.1:9301', | ||
s3.region = 'us-east-1', | ||
s3.access.key = 'hummockadmin', | ||
s3.secret.key = 'hummockadmin', | ||
primary_key = 'v1' | ||
); | ||
|
||
statement ok | ||
INSERT INTO t6 VALUES (1, 1, 2, '1-2'), (1, 2, 2, '2-2'), (1, 3, 2, '3-2'), (1, 5, 2, '5-2'), (1, 8, 2, '8-2'), (1, 13, 2, '13-2'), (1, 21, 2, '21-2'); | ||
|
||
statement ok | ||
FLUSH; | ||
|
||
statement ok | ||
INSERT INTO t6 VALUES (1, 1, 50, '1-50'); | ||
|
||
statement ok | ||
FLUSH; | ||
|
||
statement ok | ||
DROP SINK s6; | ||
|
||
statement ok | ||
DROP MATERIALIZED VIEW mv6; | ||
|
||
statement ok | ||
DROP TABLE t6; |
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,38 @@ | ||
init_sqls = [ | ||
'CREATE SCHEMA IF NOT EXISTS demo_db', | ||
'DROP TABLE IF EXISTS demo_db.demo_table', | ||
''' | ||
CREATE TABLE demo_db.demo_table ( | ||
id long, | ||
v_int int, | ||
v_long long, | ||
v_float float, | ||
v_double double, | ||
v_varchar string, | ||
v_bool boolean, | ||
v_date date, | ||
v_timestamp timestamp, | ||
v_ts_ntz timestamp_ntz | ||
) TBLPROPERTIES ('format-version'='2'); | ||
''' | ||
] | ||
|
||
slt = 'test_case/iceberg_sink_append_only.slt' | ||
|
||
verify_schema = ['long', 'int', 'long', 'float', 'double', 'string', 'boolean', 'date', 'timestamp', 'timestamp_ntz'] | ||
|
||
verify_sql = 'SELECT * FROM demo_db.demo_table ORDER BY id ASC' | ||
|
||
|
||
verify_data = """ | ||
1,1,1000,1.1,1.11,1-1,true,2022-03-11,2022-03-11 01:00:00+00:00,2022-03-11 01:00:00 | ||
2,2,2000,2.2,2.22,2-2,false,2022-03-12,2022-03-12 02:00:00+00:00,2022-03-12 02:00:00 | ||
3,3,3000,3.3,3.33,3-3,true,2022-03-13,2022-03-13 03:00:00+00:00,2022-03-13 03:00:00 | ||
4,4,4000,4.4,4.44,4-4,false,2022-03-14,2022-03-14 04:00:00+00:00,2022-03-14 04:00:00 | ||
5,5,5000,5.5,5.55,5-5,true,2022-03-15,2022-03-15 05:00:00+00:00,2022-03-15 05:00:00 | ||
""" | ||
|
||
drop_sqls = [ | ||
'DROP TABLE IF EXISTS demo_db.demo_table', | ||
'DROP SCHEMA IF EXISTS demo_db' | ||
] |
Oops, something went wrong.