Skip to content

Commit

Permalink
Add a few more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Jan 28, 2024
1 parent 5b57f15 commit 9e406a6
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions datafusion/sqllogictest/test_files/expr.slt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
----
Expand All @@ -1693,7 +1698,7 @@ NULL
671
203

# nested_subquery()
#### nested_subquery()
statement ok
CREATE TABLE test_t1 (
id INT,
Expand All @@ -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
Expand Down Expand Up @@ -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;
----
Expand Down Expand Up @@ -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;
----
Expand All @@ -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;
----
Expand Down Expand Up @@ -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;
----
Expand Down Expand Up @@ -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;
----
Expand Down Expand Up @@ -1941,6 +1967,8 @@ NULL
NULL


# query_binary_eq

statement ok
CREATE TABLE t_source(
column1 String,
Expand Down

0 comments on commit 9e406a6

Please sign in to comment.