Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Window] Support LOGICAL_OR and LOGICAL_AND #42

Merged
merged 3 commits into from
Apr 7, 2024

Conversation

ohaibbq
Copy link

@ohaibbq ohaibbq commented Apr 3, 2024

No description provided.

}
}

return BoolValue(true), nil

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be BoolValue(false)? Like if there are no trues we return False?

Might make sense to include a test case like this:

SELECT LOGICAL_OR(a) OVER (ORDER BY b), a, b
FROM (
  SELECT CAST(a AS BOOL) AS a, b FROM UNNEST([
    STRUCT(False AS a, 1 AS b), 
    STRUCT(False AS a, 2 AS b), 
    STRUCT(True AS a, 3 AS b), 
    STRUCT(False AS a, 4 AS b)
  ])
);

and also one that tests what happens when there are no rows:

SELECT LOGICAL_OR(a) OVER (ORDER BY a)
FROM (
  SELECT CAST(a AS BOOL) AS a FROM UNNEST([]) a
);

@ohaibbq ohaibbq requested a review from ageiduschek April 5, 2024 15:56
@ohaibbq ohaibbq merged commit debde73 into candidate/rb20240201 Apr 7, 2024
7 checks passed
ohaibbq added a commit that referenced this pull request Jun 29, 2024
* [Window] Support `LOGICAL_OR` and `LOGICAL_AND`

* lint

* fix LOGICAL_OR default value; add test for no rows
@ohaibbq ohaibbq deleted the dan/logical-window branch July 8, 2024 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants