clickhouse-client --format_csv_delimiter="|" -h 10.242.4.77 --port 10115 --query="INSERT INTO usermetric.tb_member_shard SELECT * FROM file('member_repurchase02.csv', 'CSV',
'statis_date String ,
member_id String ,
gds_cd String ,
pay_apply_tp String ,
dept_cd String ,
vendor_tp String ,
brand_cd String ,
l1_gds_group_cd String ,
l2_gds_group_cd String ,
l3_gds_group_cd String ,
l4_gds_group_cd String ,
str_id String ,
map_act_id String')"
clickhouse-client -h 10.242.4.77 --port 20115 --format_csv_delimiter="|" --query=" insert into replicadb.tb_member_order_shard
select
toDate(concat(substringUTF8(statis_date, 1, 4),'-',substringUTF8(statis_date, 5, 2),'-',substringUTF8(statis_date, 7, 2))),
member_id,
gds_cd,
pay_apply_tp,
dept_cd,
vendor_tp,
brand_cd,
l1_gds_group_cd,
l2_gds_group_cd,
l3_gds_group_cd,
l4_gds_group_cd,
str_id,
map_act_id
from file('member_repurchase01.csv', 'CSV',
' statis_date String,
member_id String,
gds_cd String,
pay_apply_tp String,
dept_cd String,
vendor_tp Nullable(String),
brand_cd Nullable(String),
l1_gds_group_cd Nullable(String),
l2_gds_group_cd Nullable(String),
l3_gds_group_cd Nullable(String),
l4_gds_group_cd Nullable(String),
str_id Nullable(String),
map_act_id String
'
)"