-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4720 from sundy-li/tests-improve
query(tests): improve tests
- Loading branch information
Showing
6 changed files
with
51 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,3 +161,5 @@ | |
1 | ||
1 | ||
1 1 1 1 | ||
2022-04-02 15:10:28 2022-04-02 15:10:28.000 | ||
2022-04-02 15:10:28 2022-04-02 15:10:28.221 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
tests/suites/1_stateful/00_copy/00_0000_copy_from_stage.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ontime_200.csv | ||
ontime_200.parquet | ||
199 2020 769 | ||
ontime_200.parquet | ||
ontime_200_v1.parquet | ||
398 2020 1538 |
34 changes: 34 additions & 0 deletions
34
tests/suites/1_stateful/00_copy/00_0000_copy_from_stage.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
. "$CURDIR"/../../../shell_env.sh | ||
|
||
echo "drop table if exists ontime200;" | $MYSQL_CLIENT_CONNECT | ||
## Create table | ||
cat $CURDIR/../ontime/create_table.sql | sed 's/ontime/ontime200/g' | $MYSQL_CLIENT_CONNECT | ||
|
||
|
||
aws --endpoint-url http://127.0.0.1:9900/ s3 cp s3://testbucket/admin/data/ontime_200.csv s3://testbucket/admin/stage/s1/ontime_200.csv > /dev/null 2>&1 | ||
aws --endpoint-url http://127.0.0.1:9900/ s3 cp s3://testbucket/admin/data/ontime_200.parquet s3://testbucket/admin/stage/s1/ontime_200.parquet > /dev/null 2>&1 | ||
|
||
|
||
echo "CREATE STAGE s1;" | $MYSQL_CLIENT_CONNECT | ||
echo "list @s1 PATTERN = 'ontime.*'" | $MYSQL_CLIENT_CONNECT | ||
echo "copy into ontime200 from '@s1' PATTERN = 'ontime.*parquet' FILE_FORMAT = (type = 'PARQUET');" | $MYSQL_CLIENT_CONNECT | ||
echo "select count(1), avg(Year), sum(DayOfWeek) from ontime200" | $MYSQL_CLIENT_CONNECT | ||
echo "truncate table ontime200" | $MYSQL_CLIENT_CONNECT | ||
|
||
|
||
## Copy from named external stage | ||
echo "CREATE STAGE named_external_stage url = 's3://testbucket/admin/data/' credentials=(aws_key_id='minioadmin' aws_secret_key='minioadmin');" | $MYSQL_CLIENT_CONNECT | ||
echo "list @named_external_stage PATTERN = 'ontime.*parquet'" | $MYSQL_CLIENT_CONNECT | ||
echo "copy into ontime200 from '@named_external_stage' PATTERN = 'ontime.*parquet' FILE_FORMAT = (type = 'PARQUET')" | $MYSQL_CLIENT_CONNECT | ||
echo "select count(1), avg(Year), sum(DayOfWeek) from ontime200" | $MYSQL_CLIENT_CONNECT | ||
echo "truncate table ontime200" | $MYSQL_CLIENT_CONNECT | ||
|
||
|
||
## Drop table. | ||
echo "drop table ontime200" | $MYSQL_CLIENT_CONNECT | ||
echo "drop stage if exists named_external_stage" | $MYSQL_CLIENT_CONNECT | ||
echo "drop stage if exists s1" | $MYSQL_CLIENT_CONNECT | ||
|