alamb commented on code in PR #6158:
URL: https://github.com/apache/arrow-datafusion/pull/6158#discussion_r1181236816
##########
datafusion/core/tests/sqllogictests/test_files/select.slt:
##########
@@ -265,3 +296,394 @@ query B
select column1 is not distinct from column2 from t;
----
false
+
+
+# select all
+# these two queries should return the same result
+query R
+SELECT c1 FROM aggregate_simple order by c1
+----
+0.00001
+0.00002
+0.00002
+0.00003
+0.00003
+0.00003
+0.00004
+0.00004
+0.00004
+0.00004
+0.00005
+0.00005
+0.00005
+0.00005
+0.00005
+
+query R
+SELECT ALL c1 FROM aggregate_simple order by c1
+----
+0.00001
+0.00002
+0.00002
+0.00003
+0.00003
+0.00003
+0.00004
+0.00004
+0.00004
+0.00004
+0.00005
+0.00005
+0.00005
+0.00005
+0.00005
+
+# select distinct
+query RRB rowsort
+SELECT DISTINCT * FROM aggregate_simple
+----
+0.00001 0.000000000001 true
+0.00002 0.000000000002 false
+0.00003 0.000000000003 true
+0.00004 0.000000000004 false
+0.00005 0.000000000005 true
+
+# select distinct with projection and order by
+query R
+SELECT DISTINCT c1 FROM aggregate_simple order by c1
+----
+0.00001
+0.00002
+0.00003
+0.00004
+0.00005
+
+# select distinct with multi-columns projection and single-column order by
+query RR
+SELECT DISTINCT c1, c2 FROM aggregate_simple order by c1
+----
+0.00001 0.000000000001
+0.00002 0.000000000002
+0.00003 0.000000000003
+0.00004 0.000000000004
+0.00005 0.000000000005
+
+# select distinct boolean column
+query B
+SELECT DISTINCT c3 FROM aggregate_simple order by c3
+----
+false
+true
+
+# select distinct with addition expression
+query R rowsort
+SELECT DISTINCT c1 + c2 AS a FROM aggregate_simple
+----
+0.000010000001
+0.000020000001
+0.000030000002
+0.000040000003
+0.000050000004
+
+# select distinct from
+query BBBBBBBB
+select
+1 IS DISTINCT FROM CAST(NULL as INT) as a,
+1 IS DISTINCT FROM 1 as b,
+1 IS NOT DISTINCT FROM CAST(NULL as INT) as c,
+1 IS NOT DISTINCT FROM 1 as d,
+NULL IS DISTINCT FROM NULL as e,
+NULL IS NOT DISTINCT FROM NULL as f,
+NULL is DISTINCT FROM 1 as g,
+NULL is NOT DISTINCT FROM 1 as h
+----
+true false false true false true true false
+
+query BBBBBBBB
+select
+NULL IS DISTINCT FROM NULL as a,
+NULL IS NOT DISTINCT FROM NULL as b,
+NULL is DISTINCT FROM 1 as c,
+NULL is NOT DISTINCT FROM 1 as d,
+1 IS DISTINCT FROM CAST(NULL as INT) as e,
+1 IS DISTINCT FROM 1 as f,
+1 IS NOT DISTINCT FROM CAST(NULL as INT) as g,
+1 IS NOT DISTINCT FROM 1 as h
+----
+false true true false true false false true
+
+# select distinct from utf8
+query BBBB
+select
+'x' IS DISTINCT FROM NULL as a,
+'x' IS DISTINCT FROM 'x' as b,
+'x' IS NOT DISTINCT FROM NULL as c,
+'x' IS NOT DISTINCT FROM 'x' as d
+----
+true false false true
+
+# select between simple expression
+query B
+SELECT 1 NOT BETWEEN 3 AND 5
+----
+true
+
+
+statement ok
+create table select_between_data(c1 bigint) as values (1), (2), (3), (4);
+
+# select between complex expression
+
+query B
+SELECT abs(c1) BETWEEN 0 AND LoG(c1 * 100 ) FROM select_between_data ORDER BY
c1
+----
+true
+true
+false
+false
+
+# explain select between
Review Comment:
👍 for testing the whole plan
##########
datafusion/core/tests/sqllogictests/src/main.rs:
##########
@@ -168,7 +168,7 @@ async fn context_for_test_file(relative_path: &Path) ->
SessionContext {
let ctx = SessionContext::with_config(config);
match relative_path.file_name().unwrap().to_str().unwrap() {
- "aggregate.slt" | "select.slt" => {
+ "aggregate.slt" => {
Review Comment:
❤️
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]