Skip to content

Commit

Permalink
Test for string / numeric coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Nov 29, 2024
1 parent 6512437 commit fe12502
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions datafusion/sqllogictest/test_files/string/string_query.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
# with standard values, but different types in string columns
# (String, StringView, etc.)

# --------------------------------------
# Show the input data
# --------------------------------------

# select
query TTTT
SELECT ascii_1, ascii_2, unicode_1, unicode_2 FROM test_basic_operator
Expand All @@ -35,6 +39,41 @@ _ \_ (empty) (empty)
NULL % NULL NULL
NULL R NULL 🔥

# --------------------------------------
# test type coercion (compare to int)
# queries should not error
# --------------------------------------

query BB
select ascii_1 = 1 as col1, ascii_1 = 1 as col2 from test_basic_operator;
----
false false
false false
false false
false false
false false
false false
false false
false false
false false
NULL NULL
NULL NULL

query BB
select ascii_1 <> 1 as col1, ascii_1 <> 1 as col2 from test_basic_operator;
----
true true
true true
true true
true true
true true
true true
true true
true true
true true
NULL NULL
NULL NULL

# --------------------------------------
# column comparison as filters
# --------------------------------------
Expand Down

0 comments on commit fe12502

Please sign in to comment.