Compare functions NaN update test (#50366)

Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
This commit is contained in:
Maksim Kita 2023-05-31 16:24:36 +03:00 committed by GitHub
parent 4d4112ff53
commit 2efebee5a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -7,11 +7,13 @@ SELECT nan AS lhs, cast(nan, 'Float32') AS rhs, lhs = rhs, lhs = materialize(rhs
SELECT '--';
DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table
(
id UInt32,
value UInt32
) ENGINE = MergeTree ORDER BY id;
INSERT INTO test_table VALUES (76, 57);
SELECT value FROM (SELECT stddevSamp(id) AS value FROM test_table) as subquery
@ -33,6 +35,7 @@ CREATE TABLE test_table
value_1 UInt32,
value_2 Float32
) ENGINE = MergeTree ORDER BY id;
INSERT INTO test_table VALUES (12000, 36, 77.94);
SELECT value
@ -40,3 +43,18 @@ FROM (SELECT (corr(value_1, value_1) OVER test_window) AS value FROM test_table
WHERE not (not (value <> value));
DROP TABLE test_table;
SELECT '--';
CREATE TABLE test_table
(
id Float32,
value Float32
) ENGINE=MergeTree ORDER BY id;
INSERT INTO test_table VALUES (-10.75, 95.57);
SELECT * FROM (SELECT corr(id, id) as corr_value FROM test_table GROUP BY value) AS subquery LEFT ANTI JOIN test_table ON (subquery.corr_value = test_table.id)
WHERE (test_table.id >= test_table.id) AND (NOT (test_table.id >= test_table.id));
DROP TABLE test_table;