Blizzara commented on code in PR #14042:
URL: https://github.com/apache/datafusion/pull/14042#discussion_r1907148647


##########
datafusion/functions-window/src/nth_value.rs:
##########
@@ -360,9 +360,10 @@ impl PartitionEvaluator for NthValueEvaluator {
                     })
                     .unwrap_or_default();
                 if valid_indices.is_empty() {
-                    return ScalarValue::try_from(arr.data_type());
+                    None

Review Comment:
   took me a while to figure out what's happening here; maybe instead check 
slice.nulls() explicitly and return None if it doesn't exist (i.e. there's no 
nulls)?
   
   also the pre-existing short-circuiting might be useful in cases where the 
nulls() index exists but valid_indices() truly is empty (i.e. the array is 
completely nulls)?



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