Skip to content

chore: refine copy into tests #17413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ insert into string values (''), ('null'),('128')
statement ok
remove @data/unload/parquet/null_if/

query
statement ok
copy into @data/unload/parquet/null_if from string

query
select a from @data/unload/parquet/null_if order by a
----
3 56 387
(empty)
128
null

statement ok
drop file format if exists parquet_null_if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ create table t_uuid(id string default uuid(), a int)
statement ok
remove @data/parquet/unload/uuid

query
statement ok
copy into @data/parquet/unload/uuid/ from (select 1 as a) file_format = (type = parquet)

query
select a from @data/parquet/unload/uuid/
----
1 1 374
1

query error column id doesn't exist
copy into t_uuid from @data/parquet/unload/uuid file_format = (type = parquet) RETURN_FAILED_ONLY=TRUE
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/0_stateless/05_hints/05_0001_set_var.result
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ America/Toronto
1
2022-02-02 03:00:00
2022-02-02 03:00:00
1 13 427
1 13
Asia/Shanghai
2 changes: 1 addition & 1 deletion tests/suites/0_stateless/05_hints/05_0001_set_var.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ echo "set timezone='America/Toronto'; insert /*+SET_VAR(timezone='Asia/Shanghai'
echo "drop database set_var;" | $BENDSQL_CLIENT_CONNECT
echo "drop stage if exists s2" | $BENDSQL_CLIENT_CONNECT
echo "create stage s2" | $BENDSQL_CLIENT_CONNECT
echo "copy /*+SET_VAR(timezone='Asia/Shanghai') */ into @s2 from (select timezone()); " | $BENDSQL_CLIENT_CONNECT
echo "copy /*+SET_VAR(timezone='Asia/Shanghai') */ into @s2 from (select timezone()); " | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
echo "select * from @s2 " | $BENDSQL_CLIENT_CONNECT
echo "drop stage s2" | $BENDSQL_CLIENT_CONNECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
1
200
=== test stage ===
1 8 400
1 8
0
=== test udf ===
2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ echo "select * from d_0002.t" | $TEST_USER_CONNECT
## stage
echo "=== test stage ==="
echo 'create stage hello' | $TEST_USER_CONNECT
echo 'COPY INTO @hello from (select number from numbers(1)) FILE_FORMAT = (type = parquet)' | $TEST_USER_CONNECT
echo 'COPY INTO @hello from (select number from numbers(1)) FILE_FORMAT = (type = parquet)' | $TEST_USER_CONNECT | cut -d$'\t' -f1,2
echo 'select * from @hello' | $TEST_USER_CONNECT

## udf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is require
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on database root_db for user b.
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on table root_table for user b.
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on table root_table for user b.
1 1 374
1 1
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'t1' for user 'b'@'%' with roles [public]
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.
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'t' for user 'b'@'%' with roles [public]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ echo "grant insert, delete on default.t to b" | $BENDSQL_CLIENT_CONNECT
echo "grant select on system.* to b" | $BENDSQL_CLIENT_CONNECT

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

# need err
echo "insert into t select * from t1" | $USER_B_CONNECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
1
1
2 10 399
expects .stats.write_progress.rows be 2
expects .error be null
2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../../../shell_env.sh

# set up
cat <<EOF | $BENDSQL_CLIENT_CONNECT
cat <<EOF | $BENDSQL_CLIENT_CONNECT > /dev/null
create or replace database i13947;
use i13947;
create or replace stage test_stage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
2
2
2
20 160 160
20 530 818
20 160
20 530
2
20 160 160
20 160
9 changes: 5 additions & 4 deletions tests/suites/1_stateful/00_stage/00_0001_copy_into_stage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ for i in `seq 1 10`;do
echo "insert into test_table (id,name,age) values(1,'2',3), (4, '5', 6);" | $BENDSQL_CLIENT_CONNECT
done


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


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

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

Expand Down
6 changes: 3 additions & 3 deletions tests/suites/1_stateful/00_stage/00_0012_stage_priv.result
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
==== check internal stage write priv ===
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.
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'test_table' for user 'u1'@'%' with roles [public]
20 160 160
20 160
1
==== check external stage priv ===
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.
20 160 160
20 160
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.
csv/data_UUID_0000_00000000.csv 20 0 NULL NULL
==== check internal stage read priv ===
Expand All @@ -27,7 +27,7 @@ Error: APIError: QueryFailed: [1063]Permission denied: privilege [Write] is requ
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.
000
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.
1 1 374
1 1
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.
Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is required on stage s3 for user 'u1'@'%'
Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is required on stage s3 for user 'u1'@'%'
Expand Down
12 changes: 6 additions & 6 deletions tests/suites/1_stateful/00_stage/00_0012_stage_priv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ echo "create stage s1 url = 'fs:///$STAGE_DIR/' FILE_FORMAT = (type = CSV)" | $B
echo "create user u1 identified by 'password';" | $BENDSQL_CLIENT_CONNECT
echo "grant insert on default.test_table to u1;" | $BENDSQL_CLIENT_CONNECT
echo "==== check internal stage write priv ==="
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
echo "grant Write on stage s2 to 'u1'" | $BENDSQL_CLIENT_CONNECT
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
echo "grant select on default.test_table to u1;" | $BENDSQL_CLIENT_CONNECT
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
echo "list @s2;" | $BENDSQL_CLIENT_CONNECT | wc -l | sed 's/ //g'

echo "==== check external stage priv ==="
echo "copy into @s1/csv/ from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID
echo "copy into @s1/csv/ from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
echo "grant write on stage s1 to 'u1'" | $BENDSQL_CLIENT_CONNECT
echo "copy into @s1/csv/ from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID
echo "copy into @s1/csv/ from test_table FILE_FORMAT = (type = CSV);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2
echo "copy into test_table from @s1/csv/ FILE_FORMAT = (type = CSV skip_header = 0) force=true;" | $TEST_USER_CONNECT | $RM_UUID
echo "grant read on stage s1 to 'u1'" | $BENDSQL_CLIENT_CONNECT
echo "copy into test_table from @s1/csv/ FILE_FORMAT = (type = CSV skip_header = 0) force=true;" | $TEST_USER_CONNECT | $RM_UUID
Expand Down Expand Up @@ -80,7 +80,7 @@ echo "create stage s3;" | $BENDSQL_CLIENT_CONNECT
echo "remove @s3;" | $TEST_USER_CONNECT
echo "grant write on stage s3 to u1" | $BENDSQL_CLIENT_CONNECT
echo "remove @s3;" | $TEST_USER_CONNECT
echo "copy into '@s3/a b' from (select 2);" | $TEST_USER_CONNECT | $RM_UUID
echo "copy into '@s3/a b' from (select 2);" | $TEST_USER_CONNECT | $RM_UUID | cut -d$'\t' -f1,2

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>>>> create stage my_stage url= 's3://testbucket/admin/tempdata/' connection = (connection_name='my_conn');
>>>> remove @my_stage;
>>>> copy into @my_stage/a.csv from my_table
3 13 401
3 13
>>>> select * from @my_stage order by a;
1
2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ stmt "drop connection if exists my_conn;"
stmt "create connection my_conn storage_type = 's3' access_key_id ='minioadmin' secret_access_key ='minioadmin' endpoint_url='${STORAGE_S3_ENDPOINT_URL}'"
stmt "create stage my_stage url= 's3://testbucket/admin/tempdata/' connection = (connection_name='my_conn');"
stmt "remove @my_stage;"
stmt "copy into @my_stage/a.csv from my_table"
stmt "copy into @my_stage/a.csv from my_table" | cut -d$'\t' -f1,2
query "select * from @my_stage order by a;"

stmt "drop table if exists my_table;"
Expand Down
35 changes: 19 additions & 16 deletions tests/suites/1_stateful/00_stage/00_0015_unload_output.result
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,37 @@ copy2
<<<<
copy3
<<<<
a/bc/data_UUID_0000_00000000.parquet 393 1
a/bc/data_UUID_0000_00000001.parquet 393 1
a/bc/data_UUID_0000_00000002.parquet 393 1
a/bc/data_UUID_0000_00000003.parquet 393 1
a/bc/data_UUID_0000_00000004.parquet 393 1
a/bc/data_UUID_0000_00000005.parquet 393 1
a/bc/data_UUID_0000_00000006.parquet 393 1
a/bc/data_UUID_0000_00000007.parquet 393 1
a/bc/data_UUID_0000_00000008.parquet 393 1
a/bc/data_UUID_0000_00000009.parquet 393 1
a/bc/data_UUID_0000_00000000.parquet 1
a/bc/data_UUID_0000_00000001.parquet 1
a/bc/data_UUID_0000_00000002.parquet 1
a/bc/data_UUID_0000_00000003.parquet 1
a/bc/data_UUID_0000_00000004.parquet 1
a/bc/data_UUID_0000_00000005.parquet 1
a/bc/data_UUID_0000_00000006.parquet 1
a/bc/data_UUID_0000_00000007.parquet 1
a/bc/data_UUID_0000_00000008.parquet 1
a/bc/data_UUID_0000_00000009.parquet 1
10 50
<<<<
>>>> copy into @s1/a/bc from (select * from t1) max_file_size=1 detailed_output=false
>>>> unload path
>>>> copy /*+ set_var(max_threads=1) */ into @s1 from (select 1) detailed_output=true
data_UUID_0000_00000000.parquet 374 1
data_UUID_0000_00000000.parquet 1
<<<<
>>>> copy /*+ set_var(max_threads=1) */ into @s1/ from (select 1) detailed_output=true
data_UUID_0000_00000000.parquet 374 1
data_UUID_0000_00000000.parquet 1
<<<<
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a from (select 1) detailed_output=true
a/data_UUID_0000_00000000.parquet 374 1
a/data_UUID_0000_00000000.parquet 1
<<<<
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a/ from (select 1) detailed_output=true
a/data_UUID_0000_00000000.parquet 374 1
a/data_UUID_0000_00000000.parquet 1
<<<<
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select 1) detailed_output=true
a/bc/data_UUID_0000_00000000.parquet 374 1
a/bc/data_UUID_0000_00000000.parquet 1
<<<<
>>>> copy /*+ set_var(max_threads=1) */ into @s1/a/data_ from (select 1) detailed_output=true
a/data_UUID_0000_00000000.parquet 374 1
a/data_UUID_0000_00000000.parquet 1
<<<<
>>>> drop stage if exists s1
>>>> drop table if exists t1
20 changes: 12 additions & 8 deletions tests/suites/1_stateful/00_stage/00_0015_unload_output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ echo "copy2"
query "copy into @s1/a/bc from (select * from t1) file_format = (type=csv) max_file_size=1 detailed_output=false"

echo "copy3"
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
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

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

echo ">>>> unload path"
query "copy /*+ set_var(max_threads=1) */ into @s1 from (select 1) detailed_output=true" | $RM_UUID
query "copy /*+ set_var(max_threads=1) */ into @s1/ from (select 1) detailed_output=true" | $RM_UUID
query "copy /*+ set_var(max_threads=1) */ into @s1/a from (select 1) detailed_output=true" | $RM_UUID
query "copy /*+ set_var(max_threads=1) */ into @s1/a/ from (select 1) detailed_output=true" | $RM_UUID
query "copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select 1) detailed_output=true" | $RM_UUID
query "copy /*+ set_var(max_threads=1) */ into @s1/a/data_ from (select 1) detailed_output=true" | $RM_UUID
query "copy /*+ set_var(max_threads=1) */ into @s1 from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
query "copy /*+ set_var(max_threads=1) */ into @s1/ from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
query "copy /*+ set_var(max_threads=1) */ into @s1/a from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
query "copy /*+ set_var(max_threads=1) */ into @s1/a/ from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
query "copy /*+ set_var(max_threads=1) */ into @s1/a/bc from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3
query "copy /*+ set_var(max_threads=1) */ into @s1/a/data_ from (select 1) detailed_output=true" | $RM_UUID | cut -d$'\t' -f1,3

stmt "drop stage if exists s1"
stmt "drop table if exists t1"
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ a"b 1 ['a"b'] {"k":"v"} 2044-05-06 10:25:02.868894 10.01 ('a',5) ['{"k":"v"}'] [
NULL 2 ['a'b'] [1] 2044-05-06 10:25:02.868894 -10.01 ('b',10) ['[1]'] [('b',10)]
<<<<
>>>> copy into @s1/unload1/ from test_load_unload
2 390 3096
2 390
>>>> truncate table test_load_unload
>>>> copy into test_load_unload from @s1/unload1.parquet force=true;
unload1.parquet 2 0 NULL NULL
begin diff select
end diff
>>>> copy into @s1/unload2/ from test_load_unload
2 390 3096
2 390
begin diff parquet
end diff
>>>> truncate table test_load_unload
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# unload1
query "select * from test_load_unload"
query "select * from test_load_unload" > /tmp/test_load_unload/select1.txt
stmt "copy into @s1/unload1/ from test_load_unload"
stmt "copy into @s1/unload1/ from test_load_unload" | cut -d$'\t' -f1,2
mv `ls /tmp/test_load_unload/unload1/*` /tmp/test_load_unload/unload1.parquet

# reload with copy into table
Expand All @@ -57,7 +57,7 @@
diff /tmp/test_load_unload/select1.txt /tmp/test_load_unload/select2.txt
echo "end diff"

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


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
2
--- named internal stage
2 53 791
2 53
1 2 3
4 5 6
2 53 791
2 53
--- external stage
1 2 3
4 5 6
Expand All @@ -12,6 +12,6 @@
4 5 6
2
--- variant named internal stage
2 70 767
2 70
1 [1,2,3]
2 {"k":"v"}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ echo "insert into t1 (id,name,age) values(1,'2',3), (4, '5', 6);" | $BENDSQL_CLI
echo '--- named internal stage'
echo "drop stage if exists s1;" | $BENDSQL_CLIENT_CONNECT
echo "create stage s1 FILE_FORMAT = (type = PARQUET);" | $BENDSQL_CLIENT_CONNECT
echo "copy into @s1 from t1;" | $BENDSQL_CLIENT_CONNECT
echo "copy into @s1 from t1;" | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
echo "select * from @s1;" | $BENDSQL_CLIENT_CONNECT

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

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

rm -rf ${DATADIR_PATH}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
2
2 18 596
2 18
--- copy from uri with transform
2
5
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ echo "insert into t1 (id, age) values(1,3), (4, 6);" | $BENDSQL_CLIENT_CONNECT
DATADIR_PATH="/tmp/08_00_06"
rm -rf ${DATADIR_PATH}
DATADIR="fs://$DATADIR_PATH/"
echo "copy into '${DATADIR}' from t1 FILE_FORMAT = (type = PARQUET);" | $BENDSQL_CLIENT_CONNECT
echo "copy into '${DATADIR}' from t1 FILE_FORMAT = (type = PARQUET);" | $BENDSQL_CLIENT_CONNECT | cut -d$'\t' -f1,2
touch ${DATADIR_PATH}/transform.csv


Expand Down