-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af82370
commit de6380e
Showing
4 changed files
with
75 additions
and
38 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
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_stage/00_0018_unload_csv_max_file_size.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 @@ | ||
>>>> drop stage if exists unload_csv_max_file_size; | ||
>>>> create stage unload_csv_max_file_size url='fs:///tmp/unload_csv_max_file_size/' | ||
>>>> copy into @unload_csv_max_file_size from (select * from numbers(100000000)) max_file_size=100000 file_format=(type=csv) | ||
100000000 888888890 888888890 | ||
100000000 | ||
>>>> drop stage if exists unload_csv_max_file_size; |
28 changes: 28 additions & 0 deletions
28
tests/suites/1_stateful/00_stage/00_0018_unload_csv_max_file_size.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,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
. "$CURDIR"/../../../shell_env.sh | ||
|
||
name="unload_csv_max_file_size" | ||
|
||
path="/tmp/$name/" | ||
rm -r $path/* | ||
|
||
stmt "drop stage if exists ${name};" | ||
stmt "create stage ${name} url='fs://$path'" | ||
stmt "copy into @${name} from (select * from numbers(100000000)) max_file_size=100000 file_format=(type=csv)" | ||
|
||
cat $path/* | wc -l | sed 's/ //g' | ||
|
||
|
||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
file_sizes=($(find "$path" -type f -exec stat -f "%z" {} + | sort -n -r)) | ||
else | ||
file_sizes=($(find "$path" -type f -exec stat -c "%s" {} + | sort -n -r)) | ||
fi | ||
max_size=${file_sizes[1]} | ||
|
||
if [ "$max_size" -gt 120000 ]; then | ||
echo "max_size is $max_size" | ||
fi | ||
stmt "drop stage if exists ${name};" |