From d1d72778021e9e13dc4a9a3bf4a34b53eb55ce7e Mon Sep 17 00:00:00 2001 From: Anton Popov Date: Thu, 21 Mar 2024 15:29:11 +0000 Subject: [PATCH] fix clang-tidy and test --- src/Common/ColumnsHashingImpl.h | 4 ++-- .../03009_consecutive_keys_nullable.reference | 6 +++--- .../0_stateless/03009_consecutive_keys_nullable.sql | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Common/ColumnsHashingImpl.h b/src/Common/ColumnsHashingImpl.h index c8d62fa7e6b..6b3cc24d870 100644 --- a/src/Common/ColumnsHashingImpl.h +++ b/src/Common/ColumnsHashingImpl.h @@ -67,7 +67,7 @@ template struct LastElementCache; template struct LastElementCache : public LastElementCacheBase { - Value value; + Value value{}; bool is_null = false; template @@ -79,7 +79,7 @@ struct LastElementCache : public LastElementCacheBase template struct LastElementCache : public LastElementCacheBase { - Value value; + Value value{}; template bool check(const Key & key) const { return value.first == key; } diff --git a/tests/queries/0_stateless/03009_consecutive_keys_nullable.reference b/tests/queries/0_stateless/03009_consecutive_keys_nullable.reference index 1c8064290c6..e1b9e0cba62 100644 --- a/tests/queries/0_stateless/03009_consecutive_keys_nullable.reference +++ b/tests/queries/0_stateless/03009_consecutive_keys_nullable.reference @@ -1,13 +1,13 @@ -\N 1 1 1 2 0 \N 1 1 1 2 0 +\N 1 1 \N 3 3 1 3 0 -\N 1 1 1 2 0 -\N 2 2 +\N 1 1 1 1 0 +\N 2 2 t_nullable_keys_1 0 t_nullable_keys_2 0 t_nullable_keys_3 1 diff --git a/tests/queries/0_stateless/03009_consecutive_keys_nullable.sql b/tests/queries/0_stateless/03009_consecutive_keys_nullable.sql index ee2cb5a171f..7650cf14a49 100644 --- a/tests/queries/0_stateless/03009_consecutive_keys_nullable.sql +++ b/tests/queries/0_stateless/03009_consecutive_keys_nullable.sql @@ -2,7 +2,7 @@ DROP TABLE IF EXISTS t_nullable_keys_1; CREATE TABLE t_nullable_keys_1 (x Nullable(Int64)) ENGINE = Memory; INSERT INTO t_nullable_keys_1 VALUES (1), (1), (NULL); -SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_1 GROUP BY x; +SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_1 GROUP BY x ORDER BY x; DROP TABLE t_nullable_keys_1; @@ -10,7 +10,7 @@ DROP TABLE IF EXISTS t_nullable_keys_2; CREATE TABLE t_nullable_keys_2 (x Nullable(Int64)) ENGINE = Memory; INSERT INTO t_nullable_keys_2 VALUES (NULL), (1), (1); -SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_2 GROUP BY x; +SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_2 GROUP BY x ORDER BY x; DROP TABLE t_nullable_keys_2; @@ -18,7 +18,7 @@ DROP TABLE IF EXISTS t_nullable_keys_3; CREATE TABLE t_nullable_keys_3 (x Nullable(Int64)) ENGINE = Memory; INSERT INTO t_nullable_keys_3 VALUES (NULL), (NULL), (NULL); -SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_3 GROUP BY x; +SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_3 GROUP BY x ORDER BY x; DROP TABLE t_nullable_keys_3; @@ -26,7 +26,7 @@ DROP TABLE IF EXISTS t_nullable_keys_4; CREATE TABLE t_nullable_keys_4 (x Nullable(Int64)) ENGINE = Memory; INSERT INTO t_nullable_keys_4 VALUES (1), (1), (1); -SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_4 GROUP BY x; +SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_4 GROUP BY x ORDER BY x; DROP TABLE t_nullable_keys_4; @@ -34,7 +34,7 @@ DROP TABLE IF EXISTS t_nullable_keys_5; CREATE TABLE t_nullable_keys_5 (x Nullable(Int64)) ENGINE = Memory; INSERT INTO t_nullable_keys_5 VALUES (1), (NULL), (1); -SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_5 GROUP BY x; +SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_5 GROUP BY x ORDER BY x; DROP TABLE t_nullable_keys_5; @@ -42,7 +42,7 @@ DROP TABLE IF EXISTS t_nullable_keys_6; CREATE TABLE t_nullable_keys_6 (x Nullable(Int64)) ENGINE = Memory; INSERT INTO t_nullable_keys_6 VALUES (NULL), (1), (NULL); -SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_6 GROUP BY x; +SELECT x, count(), countIf(x IS NULL) FROM t_nullable_keys_6 GROUP BY x ORDER BY x; DROP TABLE t_nullable_keys_6;