From 107360fc77654fd6031c5359c45617627da40ef0 Mon Sep 17 00:00:00 2001 From: Nikita Mikhailov Date: Wed, 30 Dec 2020 00:04:39 +0300 Subject: [PATCH] add tests --- ...rallel_formatting_csv_and_friends.reference | 8 ++++++++ ...0159_parallel_formatting_csv_and_friends.sh | 18 ++++++++++++++++++ .../00159_parallel_formatting_http.reference | 12 ++++++++++++ .../00159_parallel_formatting_http.sh | 16 ++++++++++++++++ ...allel_formatting_json_and_friends.reference | 12 ++++++++++++ ...159_parallel_formatting_json_and_friends.sh | 18 ++++++++++++++++++ ...rallel_formatting_tsv_and_friends.reference | 12 ++++++++++++ ...0159_parallel_formatting_tsv_and_friends.sh | 18 ++++++++++++++++++ 8 files changed, 114 insertions(+) create mode 100644 tests/queries/1_stateful/00159_parallel_formatting_csv_and_friends.reference create mode 100755 tests/queries/1_stateful/00159_parallel_formatting_csv_and_friends.sh create mode 100644 tests/queries/1_stateful/00159_parallel_formatting_http.reference create mode 100755 tests/queries/1_stateful/00159_parallel_formatting_http.sh create mode 100644 tests/queries/1_stateful/00159_parallel_formatting_json_and_friends.reference create mode 100755 tests/queries/1_stateful/00159_parallel_formatting_json_and_friends.sh create mode 100644 tests/queries/1_stateful/00159_parallel_formatting_tsv_and_friends.reference create mode 100755 tests/queries/1_stateful/00159_parallel_formatting_tsv_and_friends.sh diff --git a/tests/queries/1_stateful/00159_parallel_formatting_csv_and_friends.reference b/tests/queries/1_stateful/00159_parallel_formatting_csv_and_friends.reference new file mode 100644 index 00000000000..04107d74341 --- /dev/null +++ b/tests/queries/1_stateful/00159_parallel_formatting_csv_and_friends.reference @@ -0,0 +1,8 @@ +CSV, false +ea1c740f03f5dcc43a3044528ad0a98f - +CSV, true +ea1c740f03f5dcc43a3044528ad0a98f - +CSVWithNames, false +e986f353467c87b07e7143d7bff2daff - +CSVWithNames, true +e986f353467c87b07e7143d7bff2daff - diff --git a/tests/queries/1_stateful/00159_parallel_formatting_csv_and_friends.sh b/tests/queries/1_stateful/00159_parallel_formatting_csv_and_friends.sh new file mode 100755 index 00000000000..6296d722a97 --- /dev/null +++ b/tests/queries/1_stateful/00159_parallel_formatting_csv_and_friends.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. "$CURDIR"/../shell_config.sh + +FORMATS=('CSV' 'CSVWithNames') + +for format in "${FORMATS[@]}" +do + echo "$format, false"; + $CLICKHOUSE_CLIENT --output_format_parallel_formatting=false -q \ + "SELECT ClientEventTime as a, MobilePhoneModel as b, ClientIP6 as c FROM test.hits ORDER BY a, b, c Format $format" | md5sum + + echo "$format, true"; + $CLICKHOUSE_CLIENT --output_format_parallel_formatting=true -q \ + "SELECT ClientEventTime as a, MobilePhoneModel as b, ClientIP6 as c FROM test.hits ORDER BY a, b, c Format $format" | md5sum +done + diff --git a/tests/queries/1_stateful/00159_parallel_formatting_http.reference b/tests/queries/1_stateful/00159_parallel_formatting_http.reference new file mode 100644 index 00000000000..499a0b8a7c7 --- /dev/null +++ b/tests/queries/1_stateful/00159_parallel_formatting_http.reference @@ -0,0 +1,12 @@ +TSV, false +8a984bbbfb127c430f67173f5371c6cb - +TSV, true +8a984bbbfb127c430f67173f5371c6cb - +CSV, false +ea1c740f03f5dcc43a3044528ad0a98f - +CSV, true +ea1c740f03f5dcc43a3044528ad0a98f - +JSONCompactEachRow, false +ba1081a754a06ef6563840b2d8d4d327 - +JSONCompactEachRow, true +ba1081a754a06ef6563840b2d8d4d327 - diff --git a/tests/queries/1_stateful/00159_parallel_formatting_http.sh b/tests/queries/1_stateful/00159_parallel_formatting_http.sh new file mode 100755 index 00000000000..4c5fb1f066f --- /dev/null +++ b/tests/queries/1_stateful/00159_parallel_formatting_http.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. "$CURDIR"/../shell_config.sh + + +FORMATS=('TSV' 'CSV' 'JSONCompactEachRow') + +for format in "${FORMATS[@]}" +do + echo "$format, false"; + ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}&query=SELECT+ClientEventTime+as+a,MobilePhoneModel+as+b,ClientIP6+as+c+FROM+test.hits+ORDER+BY+a,b,c+Format+$format&output_format_parallel_formatting=false" -d' ' | md5sum + + echo "$format, true"; + ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}&query=SELECT+ClientEventTime+as+a,MobilePhoneModel+as+b,ClientIP6+as+c+FROM+test.hits+ORDER+BY+a,b,c+Format+$format&output_format_parallel_formatting=true" -d' ' | md5sum +done diff --git a/tests/queries/1_stateful/00159_parallel_formatting_json_and_friends.reference b/tests/queries/1_stateful/00159_parallel_formatting_json_and_friends.reference new file mode 100644 index 00000000000..96353f350ec --- /dev/null +++ b/tests/queries/1_stateful/00159_parallel_formatting_json_and_friends.reference @@ -0,0 +1,12 @@ +JSONEachRow, false +7251839681e559f5a92db107571bb357 - +JSONEachRow, true +7251839681e559f5a92db107571bb357 - +JSONCompactEachRow, false +ba1081a754a06ef6563840b2d8d4d327 - +JSONCompactEachRow, true +ba1081a754a06ef6563840b2d8d4d327 - +JSONCompactStringsEachRowWithNamesAndTypes, false +902e53f621d5336aa7f702a5d6b64b42 - +JSONCompactStringsEachRowWithNamesAndTypes, true +902e53f621d5336aa7f702a5d6b64b42 - diff --git a/tests/queries/1_stateful/00159_parallel_formatting_json_and_friends.sh b/tests/queries/1_stateful/00159_parallel_formatting_json_and_friends.sh new file mode 100755 index 00000000000..64a7b83fb86 --- /dev/null +++ b/tests/queries/1_stateful/00159_parallel_formatting_json_and_friends.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. "$CURDIR"/../shell_config.sh + + +FORMATS=('JSONEachRow' 'JSONCompactEachRow' 'JSONCompactStringsEachRowWithNamesAndTypes') + +for format in "${FORMATS[@]}" +do + echo "$format, false"; + $CLICKHOUSE_CLIENT --output_format_parallel_formatting=false -q \ + "SELECT ClientEventTime as a, MobilePhoneModel as b, ClientIP6 as c FROM test.hits ORDER BY a, b, c Format $format" | md5sum + + echo "$format, true"; + $CLICKHOUSE_CLIENT --output_format_parallel_formatting=true -q \ + "SELECT ClientEventTime as a, MobilePhoneModel as b, ClientIP6 as c FROM test.hits ORDER BY a, b, c Format $format" | md5sum +done diff --git a/tests/queries/1_stateful/00159_parallel_formatting_tsv_and_friends.reference b/tests/queries/1_stateful/00159_parallel_formatting_tsv_and_friends.reference new file mode 100644 index 00000000000..04d6db3b4af --- /dev/null +++ b/tests/queries/1_stateful/00159_parallel_formatting_tsv_and_friends.reference @@ -0,0 +1,12 @@ +TSV, false +8a984bbbfb127c430f67173f5371c6cb - +TSV, true +8a984bbbfb127c430f67173f5371c6cb - +TSVWithNames, false +ead321ed96754ff1aa39d112bc28c43d - +TSVWithNames, true +ead321ed96754ff1aa39d112bc28c43d - +TSKV, false +1735308ecea5c269846f36a55d5b335f - +TSKV, true +1735308ecea5c269846f36a55d5b335f - diff --git a/tests/queries/1_stateful/00159_parallel_formatting_tsv_and_friends.sh b/tests/queries/1_stateful/00159_parallel_formatting_tsv_and_friends.sh new file mode 100755 index 00000000000..afdda8d1453 --- /dev/null +++ b/tests/queries/1_stateful/00159_parallel_formatting_tsv_and_friends.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. "$CURDIR"/../shell_config.sh + + +FORMATS=('TSV' 'TSVWithNames' 'TSKV') + +for format in "${FORMATS[@]}" +do + echo "$format, false"; + $CLICKHOUSE_CLIENT --output_format_parallel_formatting=false -q \ + "SELECT ClientEventTime as a, MobilePhoneModel as b, ClientIP6 as c FROM test.hits ORDER BY a, b, c Format $format" | md5sum + + echo "$format, true"; + $CLICKHOUSE_CLIENT --output_format_parallel_formatting=true -q \ + "SELECT ClientEventTime as a, MobilePhoneModel as b, ClientIP6 as c FROM test.hits ORDER BY a, b, c Format $format" | md5sum +done