alamb commented on code in PR #12851:
URL: https://github.com/apache/datafusion/pull/12851#discussion_r1797022492


##########
datafusion/sqllogictest/test_files/window.slt:
##########
@@ -4929,6 +4929,15 @@ SELECT v1, NTH_VALUE(v2, 0) OVER (PARTITION BY v1 ORDER 
BY v2) FROM t;
 2 NULL
 2 NULL
 
+query I
+SELECT NTH_VALUE(tt0.v1, NULL) OVER (PARTITION BY tt0.v2 ORDER BY tt0.v1) FROM 
t AS tt0;

Review Comment:
   I double checked that without the change in this PR, this test panics as 
described in the ticket:
   
   ```
   thread 'tokio-runtime-worker' panicked at 
datafusion/physical-expr/src/window/nth_value.rs:195:63:
   attempt to subtract with overflow
   stack backtrace:
      0: rust_begin_unwind
                at 
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
      1: core::panicking::panic_fmt
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to