Skip to content

Commit 5581d25

Browse files
authored
chore: refine copy into tests (#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 ce3a170 commit 5581d25

24 files changed

+81
-68
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 56 387
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: 5 additions & 2 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 374
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

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
@@ -23,5 +23,5 @@ America/Toronto
2323
1
2424
2022-02-02 03:00:00
2525
2022-02-02 03:00:00
26-
1 13 427
26+
1 13
2727
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
@@ -35,6 +35,6 @@ echo "set timezone='America/Toronto'; insert /*+SET_VAR(timezone='Asia/Shanghai'
3535
echo "drop database set_var;" | $BENDSQL_CLIENT_CONNECT
3636
echo "drop stage if exists s2" | $BENDSQL_CLIENT_CONNECT
3737
echo "create stage s2" | $BENDSQL_CLIENT_CONNECT
38-
echo "copy /*+SET_VAR(timezone='Asia/Shanghai') */ into @s2 from (select timezone()); " | $BENDSQL_CLIENT_CONNECT
38+
echo "copy /*+SET_VAR(timezone='Asia/Shanghai') */ into @s2 from (select timezone()); " | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
3939
echo "select * from @s2 " | $BENDSQL_CLIENT_CONNECT
4040
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
@@ -2,7 +2,7 @@
22
1
33
200
44
=== test stage ===
5-
1 8 400
5+
1 8
66
0
77
=== test udf ===
88
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
@@ -101,7 +101,7 @@ Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is require
101101
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on database root_db for user b.
102102
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on table root_table for user b.
103103
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on table root_table for user b.
104-
1 1 374
104+
1 1
105105
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'t1' for user 'b'@'%' with roles [public]
106106
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 Warehouse|Database|Table|UDF|Stage.
107107
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
1
2-
1
3-
2 10 399
41
expects .stats.write_progress.rows be 2
52
expects .error be null
63
2

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

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

66
# set up
7-
cat <<EOF | $BENDSQL_CLIENT_CONNECT
7+
cat <<EOF | $BENDSQL_CLIENT_CONNECT > /dev/null
88
create or replace database i13947;
99
use i13947;
1010
create or replace stage test_stage;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
2
99
2
1010
2
11-
20 160 160
12-
20 530 818
11+
20 160
12+
20 530
1313
2
14-
20 160 160
14+
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
@@ -11,11 +11,11 @@
1111
==== check internal stage write priv ===
1212
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 Warehouse|Database|Table|UDF|Stage.
1313
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'test_table' for user 'u1'@'%' with roles [public]
14-
20 160 160
14+
20 160
1515
1
1616
==== check external stage priv ===
1717
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 Warehouse|Database|Table|UDF|Stage.
18-
20 160 160
18+
20 160
1919
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 Warehouse|Database|Table|UDF|Stage.
2020
csv/data_UUID_0000_00000000.csv 20 0 NULL NULL
2121
==== check internal stage read priv ===
@@ -27,7 +27,7 @@ Error: APIError: QueryFailed: [1063]Permission denied: privilege [Write] is requ
2727
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 Warehouse|Database|Table|UDF|Stage.
2828
000
2929
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 Warehouse|Database|Table|UDF|Stage.
30-
1 1 374
30+
1 1
3131
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 Warehouse|Database|Table|UDF|Stage.
3232
Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is required on stage s3 for user 'u1'@'%'
3333
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
>>>> create stage my_stage url= 's3://testbucket/admin/tempdata/' connection = (connection_name='my_conn');
99
>>>> remove @my_stage;
1010
>>>> copy into @my_stage/a.csv from my_table
11-
3 13 401
11+
3 13
1212
>>>> select * from @my_stage order by a;
1313
1
1414
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: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,37 @@ copy2
4040
<<<<
4141
copy3
4242
<<<<
43-
a/bc/data_UUID_0000_00000000.parquet 393 1
44-
a/bc/data_UUID_0000_00000001.parquet 393 1
45-
a/bc/data_UUID_0000_00000002.parquet 393 1
46-
a/bc/data_UUID_0000_00000003.parquet 393 1
47-
a/bc/data_UUID_0000_00000004.parquet 393 1
48-
a/bc/data_UUID_0000_00000005.parquet 393 1
49-
a/bc/data_UUID_0000_00000006.parquet 393 1
50-
a/bc/data_UUID_0000_00000007.parquet 393 1
51-
a/bc/data_UUID_0000_00000008.parquet 393 1
52-
a/bc/data_UUID_0000_00000009.parquet 393 1
43+
a/bc/data_UUID_0000_00000000.parquet 1
44+
a/bc/data_UUID_0000_00000001.parquet 1
45+
a/bc/data_UUID_0000_00000002.parquet 1
46+
a/bc/data_UUID_0000_00000003.parquet 1
47+
a/bc/data_UUID_0000_00000004.parquet 1
48+
a/bc/data_UUID_0000_00000005.parquet 1
49+
a/bc/data_UUID_0000_00000006.parquet 1
50+
a/bc/data_UUID_0000_00000007.parquet 1
51+
a/bc/data_UUID_0000_00000008.parquet 1
52+
a/bc/data_UUID_0000_00000009.parquet 1
53+
10 50
54+
<<<<
55+
>>>> copy into @s1/a/bc from (select * from t1) max_file_size=1 detailed_output=false
5356
>>>> unload path
5457
>>>> copy /*+ set_var(max_threads=1) */ into @s1 from (select 1) detailed_output=true
55-
data_UUID_0000_00000000.parquet 374 1
58+
data_UUID_0000_00000000.parquet 1
5659
<<<<
5760
>>>> copy /*+ set_var(max_threads=1) */ into @s1/ from (select 1) detailed_output=true
58-
data_UUID_0000_00000000.parquet 374 1
61+
data_UUID_0000_00000000.parquet 1
5962
<<<<
6063
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a from (select 1) detailed_output=true
61-
a/data_UUID_0000_00000000.parquet 374 1
64+
a/data_UUID_0000_00000000.parquet 1
6265
<<<<
6366
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a/ from (select 1) detailed_output=true
64-
a/data_UUID_0000_00000000.parquet 374 1
67+
a/data_UUID_0000_00000000.parquet 1
6568
<<<<
6669
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select 1) detailed_output=true
67-
a/bc/data_UUID_0000_00000000.parquet 374 1
70+
a/bc/data_UUID_0000_00000000.parquet 1
6871
<<<<
6972
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a/data_ from (select 1) detailed_output=true
70-
a/data_UUID_0000_00000000.parquet 374 1
73+
a/data_UUID_0000_00000000.parquet 1
7174
<<<<
7275
>>>> drop stage if exists s1
7376
>>>> 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
@@ -24,17 +24,21 @@ echo "copy2"
2424
query "copy into @s1/a/bc from (select * from t1) file_format = (type=csv) max_file_size=1 detailed_output=false"
2525

2626
echo "copy3"
27-
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
27+
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
2828

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

3135
echo ">>>> unload path"
32-
query "copy /*+ set_var(max_threads=1) */ into @s1 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
34-
query "copy /*+ set_var(max_threads=1) */ into @s1/a from (select 1) detailed_output=true" | $RM_UUID
35-
query "copy /*+ set_var(max_threads=1) */ into @s1/a/ from (select 1) detailed_output=true" | $RM_UUID
36-
query "copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select 1) detailed_output=true" | $RM_UUID
37-
query "copy /*+ set_var(max_threads=1) */ into @s1/a/data_ from (select 1) detailed_output=true" | $RM_UUID
36+
query "copy /*+ set_var(max_threads=1) */ into @s1 from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
37+
query "copy /*+ set_var(max_threads=1) */ into @s1/ from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
38+
query "copy /*+ set_var(max_threads=1) */ into @s1/a from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
39+
query "copy /*+ set_var(max_threads=1) */ into @s1/a/ from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
40+
query "copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
41+
query "copy /*+ set_var(max_threads=1) */ into @s1/a/data_ from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
3842

3943
stmt "drop stage if exists s1"
4044
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
@@ -29,14 +29,14 @@ a"b 1 ['a"b'] {"k":"v"} 2044-05-06 10:25:02.868894 10.01 ('a',5) ['{"k":"v"}'] [
2929
NULL 2 ['a'b'] [1] 2044-05-06 10:25:02.868894 -10.01 ('b',10) ['[1]'] [('b',10)]
3030
<<<<
3131
>>>> copy into @s1/unload1/ from test_load_unload
32-
2 390 3096
32+
2 390
3333
>>>> truncate table test_load_unload
3434
>>>> copy into test_load_unload from @s1/unload1.parquet force=true;
3535
unload1.parquet 2 0 NULL NULL
3636
begin diff select
3737
end diff
3838
>>>> copy into @s1/unload2/ from test_load_unload
39-
2 390 3096
39+
2 390
4040
begin diff parquet
4141
end diff
4242
>>>> 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,9 +1,9 @@
11
2
22
--- named internal stage
3-
2 53 791
3+
2 53
44
1 2 3
55
4 5 6
6-
2 53 791
6+
2 53
77
--- external stage
88
1 2 3
99
4 5 6
@@ -12,6 +12,6 @@
1212
4 5 6
1313
2
1414
--- variant named internal stage
15-
2 70 767
15+
2 70
1616
1 [1,2,3]
1717
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,5 +1,5 @@
11
2
2-
2 18 596
2+
2 18
33
--- copy from uri with transform
44
2
55
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)