Skip to content
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

chore: add e2e test for iceberg source scan #17281

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions e2e_test/iceberg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def drop_table(args, drop_sqls):
verify_sql = test_case.get("verify_sql")
print(f"verify_sql:{verify_sql}")
verify_data = test_case.get("verify_data")
verify_slt = test_case.get("verify_slt")
cmp_sqls = test_case.get("cmp_sqls")
drop_sqls = test_case["drop_sqls"]
config = configparser.ConfigParser()
Expand All @@ -146,6 +147,8 @@ def drop_table(args, drop_sqls):
verify_result(config, verify_sql, verify_schema, verify_data)
if cmp_sqls is not None and cmp_sqls != "" and len(cmp_sqls) == 2:
compare_sql(config, cmp_sqls)
if verify_slt is not None and verify_slt != "":
execute_slt(config, verify_slt)
if drop_sqls is not None and drop_sqls != "":
drop_table(config, drop_sqls)

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
statement ok
CREATE SOURCE iceberg_source
WITH (
connector = 'iceberg',
s3.endpoint = 'http://127.0.0.1:9301',
s3.region = 'us-east-1',
s3.access.key = 'hummockadmin',
s3.secret.key = 'hummockadmin',
catalog.type = 'storage',
warehouse.path = 's3://icebergdata/demo',
database.name = 'demo_db',
table.name = 'no_partition_append_only_table',
);

query I
SELECT id from iceberg_source ORDER by id;
----
1
2
3
4
5

statement ok
DROP SOURCE iceberg_source
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
statement ok
CREATE SOURCE iceberg_source
WITH (
connector = 'iceberg',
s3.endpoint = 'http://127.0.0.1:9301',
s3.region = 'us-east-1',
s3.access.key = 'hummockadmin',
s3.secret.key = 'hummockadmin',
catalog.type = 'storage',
warehouse.path = 's3://icebergdata/demo',
database.name = 'demo_db',
table.name = 'partition_append_only_table',
);

query I
SELECT id from iceberg_source ORDER by id;
----
1
2
3
4
5

statement ok
DROP SOURCE iceberg_source
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
statement ok
CREATE SOURCE iceberg_source
WITH (
connector = 'iceberg',
s3.endpoint = 'http://127.0.0.1:9301',
s3.region = 'us-east-1',
s3.access.key = 'hummockadmin',
s3.secret.key = 'hummockadmin',
catalog.type = 'storage',
warehouse.path = 's3://icebergdata/demo',
database.name = 'demo_db',
table.name = 'range_partition_append_only_table',
);

query I
SELECT id from iceberg_source ORDER by id;
----
1
2
3
4
5

statement ok
DROP SOURCE iceberg_source
2 changes: 2 additions & 0 deletions e2e_test/iceberg/test_case/no_partition_append_only.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ verify_data = """
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,none
"""

verify_slt = 'test_case/iceberg_sink_no_partition_append_only_table_verify.slt'

drop_sqls = [
'DROP TABLE IF EXISTS demo_db.no_partition_append_only_table',
'DROP SCHEMA IF EXISTS demo_db'
Expand Down
2 changes: 2 additions & 0 deletions e2e_test/iceberg/test_case/partition_append_only.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ verify_data = """
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,none
"""

verify_slt = 'test_case/iceberg_sink_partition_append_only_table_verify.slt'

drop_sqls = [
'DROP TABLE IF EXISTS demo_db.partition_append_only_table',
'DROP SCHEMA IF EXISTS demo_db'
Expand Down
2 changes: 2 additions & 0 deletions e2e_test/iceberg/test_case/range_partition_append_only.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ verify_data = """
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,none
"""

verify_slt = 'test_case/iceberg_sink_range_partition_append_only_table_verify.slt'

drop_sqls = [
'DROP TABLE IF EXISTS demo_db.range_partition_append_only_table',
'DROP SCHEMA IF EXISTS demo_db'
Expand Down
Loading