-
Notifications
You must be signed in to change notification settings - Fork 761
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: select from stage support ndjson.
- Loading branch information
1 parent
50d06a4
commit dde523e
Showing
15 changed files
with
147 additions
and
55 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
17 changes: 17 additions & 0 deletions
17
tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_09_select_ndjson.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,17 @@ | ||
{"a":false,"b":4,"c":4.4,"d":"gh","e":"2023-01-01","f":"2023-01-01 00:00:00","g":[10,11],"h":{"0":3,"1":"d"},"i":[1,2]} | ||
{"a":false,"b":3,"c":3.3,"d":"ef","e":"2022-01-01","f":"2022-01-01 00:00:00","g":[7,8,9],"h":{"0":2,"1":"c"},"i":"xyz"} | ||
{"a":true,"b":1,"c":1.1,"d":"ab","e":"2020-01-01","f":"2020-01-01 00:00:00","g":[1,2,3],"h":{"0":0,"1":"a"},"i":{"k":"v"}} | ||
{"a":true,"b":2,"c":2.2,"d":"cd","e":"2021-01-01","f":"2021-01-01 00:00:00","g":[4,5,6],"h":{"0":1,"1":"b"},"i":123} | ||
false | ||
false | ||
true | ||
true | ||
false 1.1 | ||
false 1.1 | ||
true 1.1 | ||
true 1.1 | ||
1.1 | ||
{"a":false,"b":3,"c":3.3,"d":"ef","e":"2022-01-01","f":"2022-01-01 00:00:00","g":[7,8,9],"h":{"0":2,"1":"c"},"i":"xyz"} | ||
{"a":false,"b":4,"c":4.4,"d":"gh","e":"2023-01-01","f":"2023-01-01 00:00:00","g":[10,11],"h":{"0":3,"1":"d"},"i":[1,2]} | ||
{"a":true,"b":1,"c":1.1,"d":"ab","e":"2020-01-01","f":"2020-01-01 00:00:00","g":[1,2,3],"h":{"0":0,"1":"a"},"i":{"k":"v"}} | ||
{"a":true,"b":2,"c":2.2,"d":"cd","e":"2021-01-01","f":"2021-01-01 00:00:00","g":[4,5,6],"h":{"0":1,"1":"b"},"i":123} |
20 changes: 20 additions & 0 deletions
20
tests/suites/1_stateful/08_select_stage/08_00_parquet/08_00_09_select_ndjson.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,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
. "$CURDIR"/../../../../shell_env.sh | ||
DATADIR_PATH="$CURDIR/../../../../data/" | ||
|
||
echo "drop stage if exists data_fs;" | $MYSQL_CLIENT_CONNECT | ||
echo "create stage data_fs url = 'fs://$DATADIR_PATH' FILE_FORMAT = (type = NDJSON)" | $MYSQL_CLIENT_CONNECT | ||
echo "drop table if exists t;" | $MYSQL_CLIENT_CONNECT | ||
echo "create table t (a variant)" | $MYSQL_CLIENT_CONNECT | ||
echo "insert into table t values (1.1)" | $MYSQL_CLIENT_CONNECT | ||
|
||
echo "select \$1 from @data_fs (files=>('json_sample.ndjson')) order by \$1;" | $MYSQL_CLIENT_CONNECT | ||
|
||
echo "select \$1:a as a from @data_fs (files=>('json_sample.ndjson')) order by a;" | $MYSQL_CLIENT_CONNECT | ||
|
||
echo "select t2.\$1:a, a from @data_fs (files=>('json_sample.ndjson')) as t2, t order by t2.\$1:a;" | $MYSQL_CLIENT_CONNECT | ||
|
||
echo "copy into t from (select \$1 from @data_fs t2) files=('json_sample.ndjson');" | $MYSQL_CLIENT_CONNECT | ||
echo "select \$1 from t order by \$1" | $MYSQL_CLIENT_CONNECT |