Skip to content

chore: fix flaky tests caused by the output_bytes column in copy into $location stmt #17224

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

Closed
Closed
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
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
3 changes: 2 additions & 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,7 @@ 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
# The last column, `output_bytes`, is intentionally removed to avoid flaky tests.
echo "copy /*+SET_VAR(timezone='Asia/Shanghai') */ into @s2 from (select timezone()); " | $BENDSQL_CLIENT_CONNECT | cut -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 -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 -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,6 @@
1
1
2 10 399
2 10
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 @@ -11,9 +11,10 @@ create or replace stage test_stage;
create or replace table tmp(id int);
insert into tmp values(1);
insert into tmp values(2);
copy into @test_stage from (select * from tmp);
EOF

echo "copy into @test_stage from (select * from i13947.tmp)" | $BENDSQL_CLIENT_CONNECT | $RM_UUID | cut -f1-2


# It is not convenient to extract the .stats.write_progress.rows from the output of bendsql,
# thus, curl is used. To prevent the immature result returned by curl(which will not poll the result until the query is finished),
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
6 changes: 3 additions & 3 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 @@ -18,12 +18,12 @@ for i in `seq 1 10`;do
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
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV);" | $BENDSQL_CLIENT_CONNECT | cut -f1-2
echo "copy into @s2 from (select name, age, id from test_table limit 100) FILE_FORMAT = (type = 'PARQUET');" | $BENDSQL_CLIENT_CONNECT | cut -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
echo "copy into @s2 from test_table FILE_FORMAT = (type = CSV) MAX_FILE_SIZE = 10;" | $BENDSQL_CLIENT_CONNECT | cut -f1-2

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

Expand Down
Loading