Skip to content

Commit d743eaa

Browse files
committed
chore: refine copy into tests (databendlabs#17413)
* test(stage): decouple `COPY INTO` tests from output data byte size The tests should not assert the exact byte size of data outputs, as this value may change across different versions of `databend-query` due to meta data of data block contains the version the `databend-query`, which is variant lengthed. This change replaces byte size checks with content validation, ensuring test stability while maintaining functional correctness. * test(stage): decouple `COPY INTO` tests from output data byte size * test(stage): decouple `COPY INTO` tests from output data byte size * test(stage): decouple `COPY INTO` tests from output data byte size * test(stage): decouple `COPY INTO` tests from output data byte size * test(stage): decouple `COPY INTO` tests from output data byte size * test(stage): decouple `COPY INTO` tests from output data byte size * test(stage): decouple `COPY INTO` tests from output data byte size 05_0001_set_var.sh * test(stage): decouple `COPY INTO` tests from output data byte size 18_0002_ownership_cover * decouple `COPY INTO` tests from output data byte size 18_0007_privilege_access * decouple `COPY INTO` tests from output data byte size 20_0015_compact_hook_stas_issue_13947 * decouple `COPY INTO` tests from output data byte size * revert scripts/ci/deploy/config/databend-query-node-1.toml
1 parent b71df62 commit d743eaa

24 files changed

+82
-69
lines changed

tests/sqllogictests/suites/stage/formats/parquet/options/null_if.test

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ insert into string values (''), ('null'),('128')
2323
statement ok
2424
remove @data/unload/parquet/null_if/
2525

26-
query
26+
statement ok
2727
copy into @data/unload/parquet/null_if from string
28+
29+
query
30+
select a from @data/unload/parquet/null_if order by a
2831
----
29-
3 40 384
32+
(empty)
33+
128
34+
null
3035

3136
statement ok
3237
drop file format if exists parquet_null_if

tests/sqllogictests/suites/stage/formats/parquet/options/parquet_missing_uuid.test

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ create table t_uuid(id string default uuid(), a int)
77
statement ok
88
remove @data/parquet/unload/uuid
99

10-
query
10+
statement ok
1111
copy into @data/parquet/unload/uuid/ from (select 1 as a) file_format = (type = parquet)
12+
13+
query
14+
select a from @data/parquet/unload/uuid/
1215
----
13-
1 1 377
16+
1
1417

1518
query error column id doesn't exist
1619
copy into t_uuid from @data/parquet/unload/uuid file_format = (type = parquet) RETURN_FAILED_ONLY=TRUE
@@ -22,7 +25,7 @@ select * from t_uuid
2225
query
2326
copy into @data/parquet/unload/uuid/ from (select 1 as a) file_format = (type = parquet)
2427
----
25-
1 1 377
28+
1 1 374
2629

2730
statement ok
2831
truncate table t_uuid

tests/suites/0_stateless/05_hints/05_0001_set_var.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ Asia/Shanghai
2222
America/Toronto
2323
2022-02-02 03:00:00
2424
2022-02-01 14:00:00
25-
1 13 415
25+
1 13
2626
Asia/Shanghai

tests/suites/0_stateless/05_hints/05_0001_set_var.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ echo "drop database set_var;" | $BENDSQL_CLIENT_CONNECT
3737

3838
echo "drop stage if exists s2" | $BENDSQL_CLIENT_CONNECT
3939
echo "create stage s2" | $BENDSQL_CLIENT_CONNECT
40-
echo "copy /*+SET_VAR(timezone='Asia/Shanghai') */ into @s2 from (select timezone()); " | $BENDSQL_CLIENT_CONNECT
40+
echo "copy /*+SET_VAR(timezone='Asia/Shanghai') */ into @s2 from (select timezone()); " | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
4141
echo "select * from @s2 " | $BENDSQL_CLIENT_CONNECT
4242
echo "drop stage s2" | $BENDSQL_CLIENT_CONNECT

tests/suites/0_stateless/18_rbac/18_0002_ownership_cover.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
=== test db/table ===
22
200
33
=== test stage ===
4-
1 8 401
4+
1 8
55
0
66
=== test udf ===
77
2

tests/suites/0_stateless/18_rbac/18_0002_ownership_cover.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ echo "select * from d_0002.t" | $TEST_USER_CONNECT
4141
## stage
4242
echo "=== test stage ==="
4343
echo 'create stage hello' | $TEST_USER_CONNECT
44-
echo 'COPY INTO @hello from (select number from numbers(1)) FILE_FORMAT = (type = parquet)' | $TEST_USER_CONNECT
44+
echo 'COPY INTO @hello from (select number from numbers(1)) FILE_FORMAT = (type = parquet)' | $TEST_USER_CONNECT | cut -d$'\t' -f1,2
4545
echo 'select * from @hello' | $TEST_USER_CONNECT
4646

4747
## udf

tests/suites/0_stateless/18_rbac/18_0007_privilege_access.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is require
9595
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on database root_db for user b.
9696
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on table root_table for user b.
9797
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on table root_table for user b.
98-
1 1 377
98+
1 1
9999
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'t1' for user 'b'@'%' with roles [public]
100100
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Read] is required on STAGE s3 for user 'b'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
101101
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'t' for user 'b'@'%' with roles [public]

tests/suites/0_stateless/18_rbac/18_0007_privilege_access.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ echo "grant insert, delete on default.t to b" | $BENDSQL_CLIENT_CONNECT
236236
echo "grant select on system.* to b" | $BENDSQL_CLIENT_CONNECT
237237

238238
echo "create stage s3;" | $BENDSQL_CLIENT_CONNECT
239-
echo "copy into '@s3/a b' from (select 2);" | $BENDSQL_CLIENT_CONNECT | $RM_UUID
239+
echo "copy into '@s3/a b' from (select 2);" | $BENDSQL_CLIENT_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
240240

241241
# need err
242242
echo "insert into t select * from t1" | $USER_B_CONNECT

tests/suites/0_stateless/20+_others/20_0015_compact_hook_stas_issue_13947.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
2 10 386
21
expects .stats.write_progress.rows be 2
32
expects .error be null
43
2

tests/suites/0_stateless/20+_others/20_0015_compact_hook_stas_issue_13947.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
44
. "$CURDIR"/../../../shell_env.sh
55

66
# set up
7-
cat <<EOF | $BENDSQL_CLIENT_CONNECT
8-
create database i13947;
7+
cat <<EOF | $BENDSQL_CLIENT_CONNECT > /dev/null
8+
create or replace database i13947;
99
use i13947;
10-
create stage test_stage;
11-
create table tmp(id int);
10+
create or replace stage test_stage;
11+
create or replace table tmp(id int);
1212
insert into tmp values(1);
1313
insert into tmp values(2);
1414
copy into @test_stage from (select * from tmp);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
20 160 160
2-
20 450 799
1+
20 160
2+
20 450
33
2
4-
20 160 160
4+
20 160

tests/suites/1_stateful/00_stage/00_0001_copy_into_stage.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ for i in `seq 1 10`;do
1717
echo "insert into test_table (id,name,age) values(1,'2',3), (4, '5', 6);" | $BENDSQL_CLIENT_CONNECT
1818
done
1919

20-
21-
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $BENDSQL_CLIENT_CONNECT
22-
echo "copy into @s2 from (select name, age, id from test_table limit 100) FILE_FORMAT = (type = 'PARQUET');" | $BENDSQL_CLIENT_CONNECT
20+
# The last column `output_bytes` is excluded to avoid flakiness
21+
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
22+
echo "copy into @s2 from (select name, age, id from test_table limit 100) FILE_FORMAT = (type = 'PARQUET');" | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
2323
echo "list @s2;" | $BENDSQL_CLIENT_CONNECT | wc -l | sed 's/ //g'
2424

2525

26-
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV) MAX_FILE_SIZE = 10;" | $BENDSQL_CLIENT_CONNECT
26+
# The last column `output_bytes` is excluded to avoid flakiness
27+
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV) MAX_FILE_SIZE = 10;" | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
2728

2829
lines=`echo "list @s2;" | $BENDSQL_CLIENT_CONNECT | wc -l`
2930

tests/suites/1_stateful/00_stage/00_0012_stage_priv.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
==== check internal stage write priv ===
22
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Write] is required on STAGE s2 for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
33
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'test_table' for user 'u1'@'%' with roles [public]
4-
20 160 160
4+
20 160
55
1
66
==== check external stage priv ===
77
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Write] is required on STAGE s1 for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
8-
20 160 160
8+
20 160
99
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Read] is required on STAGE s1 for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
1010
csv/data_UUID_0000_00000000.csv 20 0 NULL NULL
1111
==== check internal stage read priv ===
@@ -17,7 +17,7 @@ Error: APIError: QueryFailed: [1063]Permission denied: privilege [Write] is requ
1717
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Read] is required on STAGE presign_stage for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
1818
000
1919
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Write] is required on STAGE s3 for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
20-
1 1 377
20+
1 1
2121
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Read] is required on STAGE s3 for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
2222
Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is required on stage s3 for user 'u1'@'%'
2323
Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is required on stage s3 for user 'u1'@'%'

tests/suites/1_stateful/00_stage/00_0012_stage_priv.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ echo "create stage s1 url = 'fs:///$STAGE_DIR/' FILE_FORMAT = (type = CSV)" | $B
3333
echo "create user u1 identified by 'password';" | $BENDSQL_CLIENT_CONNECT
3434
echo "grant insert on default.test_table to u1;" | $BENDSQL_CLIENT_CONNECT
3535
echo "==== check internal stage write priv ==="
36-
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID
36+
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
3737
echo "grant Write on stage s2 to 'u1'" | $BENDSQL_CLIENT_CONNECT
38-
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID
38+
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
3939
echo "grant select on default.test_table to u1;" | $BENDSQL_CLIENT_CONNECT
40-
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID
40+
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
4141
echo "list @s2;" | $BENDSQL_CLIENT_CONNECT | wc -l | sed 's/ //g'
4242

4343
echo "==== check external stage priv ==="
44-
echo "copy into @s1/csv/ from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID
44+
echo "copy into @s1/csv/ from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
4545
echo "grant write on stage s1 to 'u1'" | $BENDSQL_CLIENT_CONNECT
46-
echo "copy into @s1/csv/ from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID
46+
echo "copy into @s1/csv/ from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
4747
echo "copy into test_table from @s1/csv/ FILE_FORMAT = (type = CSV skip_header = 0) force=true;" | $TEST_USER_CONNECT | $RM_UUID
4848
echo "grant read on stage s1 to 'u1'" | $BENDSQL_CLIENT_CONNECT
4949
echo "copy into test_table from @s1/csv/ FILE_FORMAT = (type = CSV skip_header = 0) force=true;" | $TEST_USER_CONNECT | $RM_UUID
@@ -80,7 +80,7 @@ echo "create stage s3;" | $BENDSQL_CLIENT_CONNECT
8080
echo "remove @s3;" | $TEST_USER_CONNECT
8181
echo "grant write on stage s3 to u1" | $BENDSQL_CLIENT_CONNECT
8282
echo "remove @s3;" | $TEST_USER_CONNECT
83-
echo "copy into '@s3/a b' from (select 2);" | $TEST_USER_CONNECT | $RM_UUID
83+
echo "copy into '@s3/a b' from (select 2);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
8484

8585
echo "grant select on system.* to u1" | $BENDSQL_CLIENT_CONNECT
8686

tests/suites/1_stateful/00_stage/00_0012_stage_with_connection.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
>>>> remove @my_stage;
99
>>>> copy into @my_stage/a.csv from my_table
1010
3 13 387
11+
3 13
1112
>>>> select * from @my_stage order by a;
1213
1
1314
2

tests/suites/1_stateful/00_stage/00_0012_stage_with_connection.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ stmt "drop connection if exists my_conn;"
1212
stmt "create connection my_conn storage_type = 's3' access_key_id ='minioadmin' secret_access_key ='minioadmin' endpoint_url='${STORAGE_S3_ENDPOINT_URL}'"
1313
stmt "create stage my_stage url= 's3://testbucket/admin/tempdata/' connection = (connection_name='my_conn');"
1414
stmt "remove @my_stage;"
15-
stmt "copy into @my_stage/a.csv from my_table"
15+
stmt "copy into @my_stage/a.csv from my_table" | cut -d$'\t' -f1,2
1616
query "select * from @my_stage order by a;"
1717

1818
stmt "drop table if exists my_table;"

tests/suites/1_stateful/00_stage/00_0015_unload_output.result

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,34 @@ a/bc/data_UUID_0000_00000009.csv 2 1
2929
<<<<
3030
<<<<
3131
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select * from t1) max_file_size=1 detailed_output=true
32-
a/bc/data_UUID_0000_00000000.parquet 378 1
33-
a/bc/data_UUID_0000_00000001.parquet 378 1
34-
a/bc/data_UUID_0000_00000002.parquet 378 1
35-
a/bc/data_UUID_0000_00000003.parquet 378 1
36-
a/bc/data_UUID_0000_00000004.parquet 378 1
37-
a/bc/data_UUID_0000_00000005.parquet 378 1
38-
a/bc/data_UUID_0000_00000006.parquet 378 1
39-
a/bc/data_UUID_0000_00000007.parquet 378 1
40-
a/bc/data_UUID_0000_00000008.parquet 378 1
41-
a/bc/data_UUID_0000_00000009.parquet 378 1
32+
a/bc/data_UUID_0000_00000000.parquet 1
33+
a/bc/data_UUID_0000_00000001.parquet 1
34+
a/bc/data_UUID_0000_00000002.parquet 1
35+
a/bc/data_UUID_0000_00000003.parquet 1
36+
a/bc/data_UUID_0000_00000004.parquet 1
37+
a/bc/data_UUID_0000_00000005.parquet 1
38+
a/bc/data_UUID_0000_00000006.parquet 1
39+
a/bc/data_UUID_0000_00000007.parquet 1
40+
a/bc/data_UUID_0000_00000008.parquet 1
41+
a/bc/data_UUID_0000_00000009.parquet 1
4242
>>>> unload path
4343
>>>> copy /*+ set_var(max_threads=1) */ into @s1 from (select 1) detailed_output=true
44-
data_UUID_0000_00000000.parquet 377 1
44+
data_UUID_0000_00000000.parquet 1
4545
<<<<
4646
>>>> copy /*+ set_var(max_threads=1) */ into @s1/ from (select 1) detailed_output=true
47-
data_UUID_0000_00000000.parquet 377 1
47+
data_UUID_0000_00000000.parquet 1
4848
<<<<
4949
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a from (select 1) detailed_output=true
50-
a/data_UUID_0000_00000000.parquet 377 1
50+
a/data_UUID_0000_00000000.parquet 1
5151
<<<<
5252
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a/ from (select 1) detailed_output=true
53-
a/data_UUID_0000_00000000.parquet 377 1
53+
a/data_UUID_0000_00000000.parquet 1
5454
<<<<
5555
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select 1) detailed_output=true
56-
a/bc/data_UUID_0000_00000000.parquet 377 1
56+
a/bc/data_UUID_0000_00000000.parquet 1
5757
<<<<
5858
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a/data_ from (select 1) detailed_output=true
59-
a/data_UUID_0000_00000000.parquet 377 1
59+
a/data_UUID_0000_00000000.parquet 1
6060
<<<<
6161
>>>> drop stage if exists s1
6262
>>>> drop table if exists t1

tests/suites/1_stateful/00_stage/00_0015_unload_output.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,21 @@ query "copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select * from t1)
2121

2222
query "copy into @s1/a/bc from (select * from t1) file_format = (type=csv) max_file_size=1 detailed_output=false"
2323

24-
query "copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select * from t1) max_file_size=1 detailed_output=true" | $RM_UUID | sort
24+
query "copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select * from t1) max_file_size=1 detailed_output=true" | $RM_UUID | tail -n +2 | sort | cut -d$'\t' -f1,3
2525

26-
query "copy into @s1/a/bc from (select * from t1) max_file_size=1 detailed_output=false" | $MYSQL
26+
# when option `detailed_output` is set to false, the result-set will have the following 3 columns:
27+
# `rows_unloaded, input_bytes, output_bytes`
28+
# https://docs.databend.com/sql/sql-commands/dml/dml-copy-into-location#detailed_output
29+
# the last column `output_bytes` will be ignored, to avoid flakiness
30+
query "copy into @s1/a/bc from (select * from t1) max_file_size=1 detailed_output=false" | sort | cut -d$'\t' -f1,2
2731

2832
echo ">>>> unload path"
29-
query "copy /*+ set_var(max_threads=1) */ into @s1 from (select 1) detailed_output=true" | $RM_UUID
30-
query "copy /*+ set_var(max_threads=1) */ into @s1/ from (select 1) detailed_output=true" | $RM_UUID
31-
query "copy /*+ set_var(max_threads=1) */ into @s1/a from (select 1) detailed_output=true" | $RM_UUID
32-
query "copy /*+ set_var(max_threads=1) */ into @s1/a/ from (select 1) detailed_output=true" | $RM_UUID
33-
query "copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select 1) detailed_output=true" | $RM_UUID
34-
query "copy /*+ set_var(max_threads=1) */ into @s1/a/data_ from (select 1) detailed_output=true" | $RM_UUID
33+
query "copy /*+ set_var(max_threads=1) */ into @s1 from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
34+
query "copy /*+ set_var(max_threads=1) */ into @s1/ from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
35+
query "copy /*+ set_var(max_threads=1) */ into @s1/a from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
36+
query "copy /*+ set_var(max_threads=1) */ into @s1/a/ from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
37+
query "copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
38+
query "copy /*+ set_var(max_threads=1) */ into @s1/a/data_ from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
3539

3640
stmt "drop stage if exists s1"
3741
stmt "drop table if exists t1"

tests/suites/1_stateful/05_formats/05_05_parquet/05_05_01_parquet_load_unload.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ a"b 1 ['a"b'] {"k":"v"} 2044-05-06 10:25:02.868894 10.01 ('a',5) ['{"k":"v"}'] [
2828
NULL 2 ['a'b'] [1] 2044-05-06 10:25:02.868894 -10.01 ('b',10) ['[1]'] [('b',10)]
2929
<<<<
3030
>>>> copy into @s1/unload1/ from test_load_unload
31-
2 362 2986
31+
2 362
3232
>>>> truncate table test_load_unload
3333
>>>> copy into test_load_unload from @s1/unload1.parquet force=true;
3434
unload1.parquet 2 0 NULL NULL
3535
begin diff select
3636
end diff
3737
>>>> copy into @s1/unload2/ from test_load_unload
38-
2 362 2986
38+
2 362
3939
begin diff parquet
4040
end diff
4141
>>>> truncate table test_load_unload

tests/suites/1_stateful/05_formats/05_05_parquet/05_05_01_parquet_load_unload.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# unload1
4444
query "select * from test_load_unload"
4545
query "select * from test_load_unload" > /tmp/test_load_unload/select1.txt
46-
stmt "copy into @s1/unload1/ from test_load_unload"
46+
stmt "copy into @s1/unload1/ from test_load_unload" | cut -d$'\t' -f1,2
4747
mv `ls /tmp/test_load_unload/unload1/*` /tmp/test_load_unload/unload1.parquet
4848

4949
# reload with copy into table
@@ -57,7 +57,7 @@
5757
diff /tmp/test_load_unload/select1.txt /tmp/test_load_unload/select2.txt
5858
echo "end diff"
5959

60-
stmt "copy into @s1/unload2/ from test_load_unload"
60+
stmt "copy into @s1/unload2/ from test_load_unload" | cut -d$'\t' -f1,2
6161
mv `ls /tmp/test_load_unload/unload2/*` /tmp/test_load_unload/unload2.parquet
6262

6363

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
--- named internal stage
2-
2 45 769
2+
2 45
33
1 2 3
44
4 5 6
5-
2 45 769
5+
2 45
66
--- external stage
77
1 2 3
88
4 5 6
99
--- file_format
1010
1 2 3
1111
4 5 6
1212
--- variant named internal stage
13-
2 70 725
13+
2 70
1414
1 [1,2,3]
1515
2 {"k":"v"}

tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_00_basic.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ echo "insert into t1 (id,name,age) values(1,'2',3), (4, '5', 6);" | $BENDSQL_CLI
1010
echo '--- named internal stage'
1111
echo "drop stage if exists s1;" | $BENDSQL_CLIENT_CONNECT
1212
echo "create stage s1 FILE_FORMAT = (type = PARQUET);" | $BENDSQL_CLIENT_CONNECT
13-
echo "copy into @s1 from t1;" | $BENDSQL_CLIENT_CONNECT
13+
echo "copy into @s1 from t1;" | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
1414
echo "select * from @s1;" | $BENDSQL_CLIENT_CONNECT
1515

1616
DATADIR_PATH="/tmp/08_00_00"
1717
rm -rf ${DATADIR_PATH}
1818
DATADIR="fs://$DATADIR_PATH/"
19-
echo "copy into '${DATADIR}' from t1 FILE_FORMAT = (type = PARQUET);" | $BENDSQL_CLIENT_CONNECT
19+
echo "copy into '${DATADIR}' from t1 FILE_FORMAT = (type = PARQUET);" | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
2020

2121
#echo '--- uri'
2222
#echo "select * from '${DATADIR}';" | $BENDSQL_CLIENT_CONNECT
@@ -38,7 +38,7 @@ echo "insert into t2 (id,data) values(1,'[1,2,3]'),(2,'{\"k\":\"v\"}');" | $BEND
3838
echo '--- variant named internal stage'
3939
echo "drop stage if exists s4;" | $BENDSQL_CLIENT_CONNECT
4040
echo "create stage s4 FILE_FORMAT = (type = PARQUET);" | $BENDSQL_CLIENT_CONNECT
41-
echo "copy into @s4 from t2;" | $BENDSQL_CLIENT_CONNECT
41+
echo "copy into @s4 from t2;" | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
4242
echo "select * from @s4;" | $BENDSQL_CLIENT_CONNECT
4343

4444
rm -rf ${DATADIR_PATH}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2 18 572
1+
2 18
22
--- copy from uri with transform
33
2
44
5

tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_06_transform.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ echo "insert into t1 (id, age) values(1,3), (4, 6);" | $BENDSQL_CLIENT_CONNECT
1010
DATADIR_PATH="/tmp/08_00_06"
1111
rm -rf ${DATADIR_PATH}
1212
DATADIR="fs://$DATADIR_PATH/"
13-
echo "copy into '${DATADIR}' from t1 FILE_FORMAT = (type = PARQUET);" | $BENDSQL_CLIENT_CONNECT
13+
echo "copy into '${DATADIR}' from t1 FILE_FORMAT = (type = PARQUET);" | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
1414
touch ${DATADIR_PATH}/transform.csv
1515

1616

0 commit comments

Comments
 (0)