From aa6bcf94f58f9054fe08f2f5d15a733dd67b1a77 Mon Sep 17 00:00:00 2001 From: Kousuke Saruta Date: Sat, 2 Sep 2023 01:12:05 +0900 Subject: [PATCH] Make sqllogictests platform-independent for the sign of NaNs --- .../sqllogictest/test_files/predicates.slt | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/datafusion/sqllogictest/test_files/predicates.slt b/datafusion/sqllogictest/test_files/predicates.slt index a168dfe361b9..0c0dd9a5cbd7 100644 --- a/datafusion/sqllogictest/test_files/predicates.slt +++ b/datafusion/sqllogictest/test_files/predicates.slt @@ -254,39 +254,45 @@ foo fazzz statement ok -CREATE TABLE IF NOT EXISTS test_float AS VALUES(1.2),(2.1),(NULL),('NaN'::double),('-NaN'::double); +CREATE TABLE IF NOT EXISTS test_float AS VALUES + ('a', 1.2), + ('b', 2.1), + ('c', NULL), + ('d', 'NaN'::double), + ('e', '-NaN'::double) + ; # IN expr for float -query R -SELECT * FROM test_float WHERE column1 IN (0.0, -1.2) +query T +SELECT column1 FROM test_float WHERE column2 IN (0.0, -1.2) ---- -query R -SELECT * FROM test_float WHERE column1 IN (0.0, 1.2) +query T +SELECT column1 FROM test_float WHERE column2 IN (0.0, 1.2) ---- -1.2 +a -query R -SELECT * FROM test_float WHERE column1 IN (2.1, 1.2) +query T +SELECT column1 FROM test_float WHERE column2 IN (2.1, 1.2) ---- -1.2 -2.1 +a +b -query R -SELECT * FROM test_float WHERE column1 IN (0.0, 1.2, NULL) +query T +SELECT column1 FROM test_float WHERE column2 IN (0.0, 1.2, NULL) ---- -1.2 +a -query R -SELECT * FROM test_float WHERE column1 IN (0.0, -1.2, NULL) +query T +SELECT column1 FROM test_float WHERE column2 IN (0.0, -1.2, NULL) ---- -query R -SELECT * FROM test_float WHERE column1 IN (0.0, 1.2, 'NaN'::double, '-NaN'::double) +query T +SELECT column1 FROM test_float WHERE column2 IN (0.0, 1.2, 'NaN'::double, '-NaN'::double) ---- -1.2 -NaN -NaN +a +d +e ### # Test logical plan simplifies large OR chains