For now our test for write is hard extend to test kinds of table. The schema is hard-code.
So I propose a way to make test more easily to extend.
schema:
init_sql:
CREATE SCHEMA IF NOT EXISTS s1
src:
name: t1
root: demo/s1/t1
init_sql:
DROP TABLE IF EXISTS s1.t1,
CREATE TABLE s1.t1
(
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_decimal decimal(36, 10),
v_ts_ntz timestamp_ntz
) USING iceberg
TBLPROPERTIES ('format-version'='2');
dst:
name: tmp
root: demo/s1/tmp
init_sql:
DROP TABLE IF EXISTS s1.tmp,
CREATE TABLE s1.tmp
(
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_decimal decimal(36, 10),
v_ts_ntz timestamp_ntz
) USING iceberg
TBLPROPERTIES ('format-version'='2');
write_data:
schema: long,int,float,double,string,boolean,date,timestamp ..
data:
1,1,1000,1.1,1.11,1-1,true,2022-11-01,2022-11-01 11:03:02.123456+04:00,389.11111,2022-11-01 11:03:02.123456
2,2,2000,2.2,2.22,2-2,false,2022-11-02,2022-11-02 11:03:02.123456+04:00,389.2222,2022-11-02 11:03:02.123456
3,3,3000,3.3,3.33,3-3,true,2022-11-03,2022-11-03 11:03:02.123456+04:00,389.3333,2022-11-03 11:03:02.123456
4,4,4000,4.4,4.44,4-4,false,2022-11-04,2022-11-04 11:04:02.123456+04:00,389.4444,2022-11-04 11:04:02.123456
5,5,5000,5.5,5.55,5-5,true,2022-11-05,2022-11-05 11:05:02.123456+04:00,389.5555,2022-11-05 11:05:02.123456
query_sql:
select * from s1.t1;
select * from s1.tmp;
query_sql:
select * from s1.t1.partitions;
select * from s1.tmp.partitions;