Skip to content

Commit

Permalink
add e2e test for source scan
Browse files Browse the repository at this point in the history
  • Loading branch information
ZENOTME committed Jun 17, 2024
1 parent b6f8f46 commit 630bcde
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 0 deletions.
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,22 @@
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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
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

0 comments on commit 630bcde

Please sign in to comment.