From 9e406a6681ea0c810272053dcbe947f69ab24c95 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Sun, 28 Jan 2024 07:59:43 -0500 Subject: [PATCH] Add a few more comments --- datafusion/sqllogictest/test_files/expr.slt | 34 +++++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/datafusion/sqllogictest/test_files/expr.slt b/datafusion/sqllogictest/test_files/expr.slt index 2f35dd828a07..1a2dcf3a91f9 100644 --- a/datafusion/sqllogictest/test_files/expr.slt +++ b/datafusion/sqllogictest/test_files/expr.slt @@ -1660,6 +1660,9 @@ SELECT regexp_match('aaa-0', NULL); ---- NULL +##### csv_query_nullif_divide_by_0 + + statement ok CREATE EXTERNAL TABLE aggregate_test_100_by_sql ( c1 VARCHAR NOT NULL, @@ -1680,6 +1683,8 @@ STORED AS CSV WITH HEADER ROW LOCATION '../../testing/data/csv/aggregate_test_100.csv' + + query I SELECT c8/nullif(c7, 0) FROM aggregate_test_100_by_sql LIMIT 9 OFFSET 81; ---- @@ -1693,7 +1698,7 @@ NULL 671 203 -# nested_subquery() +#### nested_subquery() statement ok CREATE TABLE test_t1 ( id INT, @@ -1706,14 +1711,14 @@ CREATE TABLE test_t2 ( a INT ) -# the purpose of this test is just to make sure the query produces a valid plan +# the purpose of this test is just to make sure the query produces a valid plan query I SELECT COUNT(*) as cnt FROM ((SELECT id FROM test_t1) EXCEPT (SELECT id FROM test_t2)) foo; ---- 0 -# comparisons_with_null_lt +#### comparisons_with_null_lt # 1. Numeric comparison with NULL query B @@ -1766,6 +1771,12 @@ select column2 < NULL from (VALUES (1, 'foo' ,2.3), (2, 'bar', 5.4)) as t; NULL NULL +##### +# same queries, reversed argument order (as they go through +# a different evaluation path) +##### + +# Boolean comparison with NULL query B select column1 < NULL from (VALUES (true), (false)) as t; ---- @@ -1808,24 +1819,30 @@ select NULL != column1 from (VALUES (1, 'foo' ,2.3), (2, 'bar', 5.4)) as t; NULL NULL +# 1.1 Float value comparison with NULL query B select NULL < column3 from (VALUES (1, 'foo' ,2.3), (2, 'bar', 5.4)) as t; ---- NULL NULL +# String comparison with NULL query B select NULL < column2 from (VALUES (1, 'foo' ,2.3), (2, 'bar', 5.4)) as t; ---- NULL NULL +# Boolean comparison with NULL query B select NULL < column1 from (VALUES (true), (false)) as t; ---- NULL NULL +#### binary_mathematical_operator_with_null_lt + +# 1. Integer and NULL query I select column1 + NULL from (VALUES (1, 2.3), (2, 5.4)) as t; ---- @@ -1850,6 +1867,7 @@ select column1 % NULL from (VALUES (1, 2.3), (2, 5.4)) as t; NULL NULL +# 2. Float and NULL query R select column2 + NULL from (VALUES (1, 2.3), (2, 5.4)) as t; ---- @@ -1880,6 +1898,12 @@ select column2 % NULL from (VALUES (1, 2.3), (2, 5.4)) as t; NULL NULL +##### +# same queries, reversed argument order (as they go through +# a different evaluation path) +##### + +# 3. NULL and Integer query I select NULL + column1 from (VALUES (1, 2.3), (2, 5.4)) as t; ---- @@ -1910,6 +1934,8 @@ select NULL % column1 from (VALUES (1, 2.3), (2, 5.4)) as t; NULL NULL +# 4. NULL and Float + query R select NULL + column2 from (VALUES (1, 2.3), (2, 5.4)) as t; ---- @@ -1941,6 +1967,8 @@ NULL NULL +# query_binary_eq + statement ok CREATE TABLE t_source( column1 String,