@@ -39,9 +39,12 @@ copy_from_stage_cases=(
39
39
" copy into ontime200 from @s1 PATTERN = 'ontime.*ndjson$' FILE_FORMAT = (type = 'ndjson');"
40
40
)
41
41
42
+ # # Copy file twiice but return the same result to test idempotent-copy
42
43
for i in " ${copy_from_stage_cases[@]} " ; do
43
44
echo " $i " | $MYSQL_CLIENT_CONNECT
44
45
echo " select count(1), avg(Year), sum(DayOfWeek) from ontime200" | $MYSQL_CLIENT_CONNECT
46
+ echo " $i " | $MYSQL_CLIENT_CONNECT
47
+ echo " select count(1), avg(Year), sum(DayOfWeek) from ontime200" | $MYSQL_CLIENT_CONNECT
45
48
echo " truncate table ontime200" | $MYSQL_CLIENT_CONNECT
46
49
done
47
50
@@ -63,9 +66,12 @@ copy_from_named_external_stage_cases=(
63
66
" copy into ontime200 from @named_external_stage FILES = ('ontime_200.csv.gz','ontime_200.csv.bz2','ontime_200.csv.zst') FILE_FORMAT = (type = 'CSV' field_delimiter = ',' compression = 'auto' record_delimiter = '\n' skip_header = 1);"
64
67
)
65
68
69
+ # # Copy file twiice but return the same result to test idempotent-copy
66
70
for i in " ${copy_from_named_external_stage_cases[@]} " ; do
67
71
echo " $i " | $MYSQL_CLIENT_CONNECT
68
72
echo " select count(1), avg(Year), sum(DayOfWeek) from ontime200" | $MYSQL_CLIENT_CONNECT
73
+ echo " $i " | $MYSQL_CLIENT_CONNECT
74
+ echo " select count(1), avg(Year), sum(DayOfWeek) from ontime200" | $MYSQL_CLIENT_CONNECT
69
75
echo " truncate table ontime200" | $MYSQL_CLIENT_CONNECT
70
76
done
71
77
@@ -82,6 +88,13 @@ echo $cmd | $MYSQL_CLIENT_CONNECT
82
88
# # list stage has metacache, so we just we aws client to ensure the data are purged
83
89
aws --endpoint-url ${STORAGE_S3_ENDPOINT_URL} s3 ls s3://testbucket/admin/stage/s1/ | grep -o ontime_200.csv | wc -l
84
90
91
+ # # copy with force=true
92
+ echo " truncate table ontime200" | $MYSQL_CLIENT_CONNECT
93
+ cmd=" copy into ontime200 from @s1 PATTERN = 'ontime.*parquet$' FILE_FORMAT = (type = 'PARQUET') force=true;"
94
+ echo $cmd | $MYSQL_CLIENT_CONNECT
95
+ echo $cmd | $MYSQL_CLIENT_CONNECT
96
+ echo " select count(1), avg(Year), sum(DayOfWeek) from ontime200" | $MYSQL_CLIENT_CONNECT
97
+
85
98
# # Drop table.
86
99
echo " drop table ontime200" | $MYSQL_CLIENT_CONNECT
87
100
echo " drop stage if exists named_external_stage" | $MYSQL_CLIENT_CONNECT
0 commit comments