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 Function offset correction for RAC #16718

Merged
merged 7 commits into from
Jul 15, 2024

Conversation

sreemanamala
Copy link
Contributor

@sreemanamala sreemanamala commented Jul 10, 2024

Description

Changes in this commit :

  1. When an ArrayList RAC creates a child RAC, the start and end offsets need to have the offset of parent's start offset
  2. Defaults the 2nd window bound to CURRENT ROW when only a single bound is specified
  3. Removes the windowingStrictValidation warning and throws a hard exception when Order By alongside RANGE clause is not provided with UNBOUNDED or CURRENT ROW as both bounds

Key changed/added classes in this PR
  • DruidSqlValidator
  • ArrayListRowsAndColumns

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.

Comment on lines -13 to -15
'k(1)',
COUNT(1) OVER (ORDER BY FLOOR(m1/3) ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING),
COUNT(1) OVER (ORDER BY FLOOR(m1/3) RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING)
Copy link
Member

Choose a reason for hiding this comment

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

why remove this test; and not just these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, make sense to just remove these 1 PRECEDING AND 1 FOLLOWING. Later on when we start supporting them, we can modify this test to keep the comparisons between ROWS and RANGE in different scenarios at one place. will update it. Thanks for the review @kgyrtkirk !!

@kgyrtkirk kgyrtkirk merged commit 78a4a09 into apache:master Jul 15, 2024
88 checks passed
sreemanamala added a commit to sreemanamala/druid that referenced this pull request Aug 6, 2024
* When an ArrayList RAC creates a child RAC, the start and end offsets need to have the offset of parent's start offset
* Defaults the 2nd window bound to CURRENT ROW when only a single bound is specified
* Removes the windowingStrictValidation warning and throws a hard exception when Order By alongside RANGE clause is not provided with UNBOUNDED or CURRENT ROW as both bounds
@sreemanamala sreemanamala deleted the rac-offset branch September 18, 2024 11:24
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 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.

3 participants