From a8f5d9e70fef1202285eab1911f7aa794e0828f6 Mon Sep 17 00:00:00 2001 From: myrrc Date: Wed, 9 Sep 2020 15:52:44 +0300 Subject: [PATCH] added the test and comment --- src/Columns/ColumnLowCardinality.h | 4 ++++ .../0_stateless/01414_low_cardinality_nullable.reference | 1 + tests/queries/0_stateless/01414_low_cardinality_nullable.sql | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/Columns/ColumnLowCardinality.h b/src/Columns/ColumnLowCardinality.h index 00f58a133cf..0aeda4567fd 100644 --- a/src/Columns/ColumnLowCardinality.h +++ b/src/Columns/ColumnLowCardinality.h @@ -171,6 +171,10 @@ public: bool isNumeric() const override { return getDictionary().isNumeric(); } bool lowCardinality() const override { return true; } + /** + * Checks if the dictionary column is Nullable(T). + * So LC(Nullable(T)) would return true, LC(U) -- false. + */ bool nestedIsNullable() const { return isColumnNullable(*dictionary.getColumnUnique().getNestedColumn()); } const IColumnUnique & getDictionary() const { return dictionary.getColumnUnique(); } diff --git a/tests/queries/0_stateless/01414_low_cardinality_nullable.reference b/tests/queries/0_stateless/01414_low_cardinality_nullable.reference index bf7b6cf4f76..51825f5cb76 100644 --- a/tests/queries/0_stateless/01414_low_cardinality_nullable.reference +++ b/tests/queries/0_stateless/01414_low_cardinality_nullable.reference @@ -80,3 +80,4 @@ 1 1 1 +2 diff --git a/tests/queries/0_stateless/01414_low_cardinality_nullable.sql b/tests/queries/0_stateless/01414_low_cardinality_nullable.sql index 6e311f9d519..9a554ead776 100644 --- a/tests/queries/0_stateless/01414_low_cardinality_nullable.sql +++ b/tests/queries/0_stateless/01414_low_cardinality_nullable.sql @@ -217,4 +217,6 @@ SELECT count() FROM lc_nullable WHERE has(date_time, toDateTime('1970-01-01 03:0 SELECT count() FROM lc_nullable WHERE has(str, '100'); SELECT count() FROM lc_nullable WHERE has(fixed_string, toFixedString('100', 5)); +SELECT count() FROM lc_nullable WHERE has(date, toDate(has(u64, 1), '1970-01\002')); + DROP TABLE IF EXISTS lc_nullable;