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

Strict window frame checks #15746

Merged
merged 10 commits into from
Feb 2, 2024
Merged

Conversation

kgyrtkirk
Copy link
Member

@kgyrtkirk kgyrtkirk commented Jan 23, 2024

Description

Fixed the bug ...

Renamed the class ...

Added a forbidden-apis entry ...

Release note


Key changed/added classes in this PR
  • MyFoo
  • OurBar
  • TheirBaz

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

* introduce check to ensure that window frame is supported
  * currently RANGE frames are only supported correctly if both endpoints are unbounded or current row
* add `windowingStrictValidation` context key to provide a way to override the check
@pranavbhole
Copy link
Contributor

fyi: @317brian we need to document this context flag.

Copy link
Contributor

@techdocsmith techdocsmith left a comment

Choose a reason for hiding this comment

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

Suggest style improvement

Copy link
Contributor

@techdocsmith techdocsmith left a comment

Choose a reason for hiding this comment

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

style suggestion

@soumyava
Copy link
Contributor

Can we put some more context in the description as to what the issue with range we are facing and also a github issue with what needs to be fix in the long run so that we can retire this custom query context when the time comes

@kgyrtkirk
Copy link
Member Author

@soumyava I've updated the patch ; added refereces to #15739 #15767 ; and also added a check to ensure that expressions are not processed as lower/upper bounds - don't think anyone would try to do that; but with this change it will result in a nice error message

Copy link
Contributor

@soumyava soumyava left a comment

Choose a reason for hiding this comment

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

LGTM. The checks will be updated once the fix for #15739 is merged in. The failure here is unrelated but we should merge master into it

@abhishekagarwal87 abhishekagarwal87 merged commit 8f5b752 into apache:master Feb 2, 2024
82 of 83 checks passed
kgyrtkirk added a commit to kgyrtkirk/druid that referenced this pull request Feb 2, 2024
introduce checks to ensure that window frame is supported
added check to ensure that no expressions are set as bounds
added logic to detect following/following like cases - described in Window function fails to demarcate if 2 following are used apache#15739
currently RANGE frames are only supported correctly if both endpoints are unbounded or current row Offset based window range support apache#15767
added windowingStrictValidation context key to provide a way to override the check

(cherry picked from commit 8f5b752)
kgyrtkirk added a commit to kgyrtkirk/druid that referenced this pull request Feb 2, 2024
introduce checks to ensure that window frame is supported
added check to ensure that no expressions are set as bounds
added logic to detect following/following like cases - described in Window function fails to demarcate if 2 following are used apache#15739
currently RANGE frames are only supported correctly if both endpoints are unbounded or current row Offset based window range support apache#15767
added windowingStrictValidation context key to provide a way to override the check

(cherry picked from commit 8f5b752)
abhishekagarwal87 pushed a commit that referenced this pull request Feb 5, 2024
introduce checks to ensure that window frame is supported
added check to ensure that no expressions are set as bounds
added logic to detect following/following like cases - described in Window function fails to demarcate if 2 following are used #15739
currently RANGE frames are only supported correctly if both endpoints are unbounded or current row Offset based window range support #15767
added windowingStrictValidation context key to provide a way to override the check

(cherry picked from commit 8f5b752)
@techdocsmith techdocsmith mentioned this pull request Feb 13, 2024
9 tasks
@adarshsanjeev adarshsanjeev added this to the 30.0.0 milestone May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants