From 6e9589f6abc36d4c96860f87f385093ac532505b Mon Sep 17 00:00:00 2001 From: Denis Zhuravlev Date: Tue, 15 Jun 2021 17:41:07 -0300 Subject: [PATCH] test for null_array_orc_load --- .../00900_null_array_orc_load.reference | 3 ++ .../0_stateless/00900_null_array_orc_load.sh | 27 ++++++++++++++++++ .../0_stateless/data_orc/test_null_array.orc | Bin 0 -> 442 bytes 3 files changed, 30 insertions(+) create mode 100644 tests/queries/0_stateless/00900_null_array_orc_load.reference create mode 100644 tests/queries/0_stateless/00900_null_array_orc_load.sh create mode 100644 tests/queries/0_stateless/data_orc/test_null_array.orc diff --git a/tests/queries/0_stateless/00900_null_array_orc_load.reference b/tests/queries/0_stateless/00900_null_array_orc_load.reference new file mode 100644 index 00000000000..b82db8ca1ef --- /dev/null +++ b/tests/queries/0_stateless/00900_null_array_orc_load.reference @@ -0,0 +1,3 @@ +[0] ['Test 0'] +[NULL] [NULL] +[] [] diff --git a/tests/queries/0_stateless/00900_null_array_orc_load.sh b/tests/queries/0_stateless/00900_null_array_orc_load.sh new file mode 100644 index 00000000000..a303e50a04a --- /dev/null +++ b/tests/queries/0_stateless/00900_null_array_orc_load.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +# shellcheck source=../shell_config.sh +. "$CUR_DIR"/../shell_config.sh + +DATA_FILE=$CUR_DIR/data_orc/test_null_array.orc + +${CLICKHOUSE_CLIENT} --query="DROP TABLE IF EXISTS test_null_array_orc" +${CLICKHOUSE_CLIENT} --query="CREATE TABLE test_null_array_orc(col0 Array(Nullable(Int64)),col1 Array(Nullable(String))) ENGINE = Memory" +cat "$DATA_FILE" | ${CLICKHOUSE_CLIENT} -q "insert into test_null_array_orc format ORC" +${CLICKHOUSE_CLIENT} --query="select * from test_null_array_orc" + +${CLICKHOUSE_CLIENT} --query="drop table test_null_array_orc" + +# +# test_null_array.orc is impossible to create using CH because it stores NULL instead of empty array +# but CH able to ingest it as empty array [] +# +# import pyorc +# with open("test_null_array.orc", "wb") as data: +# with pyorc.Writer(data, "struct,col1:array>") as writer: +# writer.write(([0], ["Test 0"])) +# writer.write(([None], [None])) +# writer.write((None, None)) +# +# diff --git a/tests/queries/0_stateless/data_orc/test_null_array.orc b/tests/queries/0_stateless/data_orc/test_null_array.orc new file mode 100644 index 0000000000000000000000000000000000000000..a70dcabd8a207480cd9fe6d13dc0196a1e60c678 GIT binary patch literal 442 zcmeYda+YOa;Nsz8VE_Ul77peB1{ns1$B&*Tr8h7rit#ODaAVK`3J5_2BpS6-dUeUWdfiFt zOL@!B9k`IQHLfOm^ORKk1kcs+4~5FPy)@i;(`GE1uljw`wJnFPTz$RnbG*;L*~{-d zu4GIBI&{;cq=yN72@I2b7<*!DWO|%(WO$f(gm@g}Tzs0E13f#sbyc?Ra5?C};pP2- z#ej+72~bml*pE{hM~@!VnV_7w^uhXrYg7&%R6cU#gwD}PbLJ;AsPT$Qm`LzQOxa<% zqeWuo0vSHOw3I}#9R}7dsRwe79y%yEz3yIbn77{EHDiRGg9Wz+i7f%up ykM_ta>}+Zjm@@4FXF|!02hR_3FmRL#FiJEuuqZJx@MxGCur+;QX7&$q76$-$NtMa~ literal 0 HcmV?d00001