cht42 opened a new issue, #14041:
URL: https://github.com/apache/datafusion/issues/14041

   ### Describe the bug
   
   When the input values doesn't have any null setting `ignoreNulls` to true on 
`nth_value` window functions returns always `NULL`.
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   When no nulls in tables, `nth_value` should return the same values wether 
`ignore_nulls` is true or false
   ```
   statement ok
   CREATE TABLE t AS VALUES  (3, 3), (4, 4), (5, 5), (6, 6);
   
   query I
   SELECT column1 FROM t ORDER BY column2;
   ----
   3
   4
   5
   6
   
   query I
   SELECT nth_VALUE(column1, 1) OVER(ORDER BY column2) FROM t;
   ----
   3
   3
   3
   3
   
   query I
   SELECT nth_VALUE(column1, 1) IGNORE NULLS OVER(ORDER BY column2) FROM t;
   ----
   3
   3
   3
   3
   
   statement ok
   DROP TABLE t;
   ```
   
   
   ### Additional context
   
   _No response_


-- 
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: github-unsubscr...@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to