mustafasrepo commented on code in PR #9470:
URL: https://github.com/apache/arrow-datafusion/pull/9470#discussion_r1515767849


##########
datafusion/sqllogictest/test_files/window.slt:
##########
@@ -4269,3 +4269,199 @@ LIMIT 5;
 3 53
 24 31
 14 94
+
+# Test for ignore nulls in FIRST_VALUE
+statement ok
+CREATE TABLE t AS VALUES (null::bigint), (3), (4);
+
+query I
+SELECT FIRST_VALUE(column1) OVER() FROM t;
+----
+NULL
+NULL
+NULL
+
+query I
+SELECT FIRST_VALUE(column1) RESPECT NULLS OVER() FROM t;
+----
+NULL
+NULL
+NULL
+
+query I
+SELECT FIRST_VALUE(column1) IGNORE NULLS OVER() FROM t;
+----
+3
+3
+3
+
+statement ok
+DROP TABLE t;
+
+# Test for ignore nulls with ORDER BY in FIRST_VALUE
+statement ok
+CREATE TABLE t AS VALUES  (3, 4), (4, 3), (null::bigint, 1), (null::bigint, 1);
+
+query I
+SELECT column1 FROM t ORDER BY column2;
+----
+NULL
+NULL
+4
+3
+
+query I
+SELECT FIRST_VALUE(column1) OVER(ORDER BY column2) FROM t;

Review Comment:
   Also  queries that include `ORDER BY <expr>`  might as well include `<expr>` 
in the `SELECT`. That way query is much more readable, and we can keep track 
expected behaviour from the result. However, this is purely stylistic.



-- 
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]

Reply via email to