alamb commented on code in PR #4616:
URL: https://github.com/apache/arrow-datafusion/pull/4616#discussion_r1050056044
##########
datafusion/expr/src/window_frame.rs:
##########
@@ -147,6 +147,17 @@ pub enum WindowFrameBound {
Following(ScalarValue),
}
+impl WindowFrameBound {
+ /// check the frame is UNBOUNDED or not
+ pub fn is_unbounded(&self) -> bool {
+ match self {
+ WindowFrameBound::Preceding(x) => x.eq(&ScalarValue::Null),
+ WindowFrameBound::CurrentRow => false,
+ WindowFrameBound::Following(x) => x.eq(&ScalarValue::Null),
Review Comment:
```suggestion
WindowFrameBound::Preceding(x) => x.is_null(),
WindowFrameBound::CurrentRow => false,
WindowFrameBound::Following(x) => x.is_null(),
```
##########
datafusion/expr/src/window_frame.rs:
##########
@@ -147,6 +147,17 @@ pub enum WindowFrameBound {
Following(ScalarValue),
}
+impl WindowFrameBound {
+ /// check the frame is UNBOUNDED or not
+ pub fn is_unbounded(&self) -> bool {
+ match self {
+ WindowFrameBound::Preceding(x) => x.eq(&ScalarValue::Null),
+ WindowFrameBound::CurrentRow => false,
+ WindowFrameBound::Following(x) => x.eq(&ScalarValue::Null),
Review Comment:
I recommend using `x.is_null()` so that it also catches typed nulls (like
`ScalarValue::UInt6(None)`)
--
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]