druid icon indicating copy to clipboard operation
druid copied to clipboard

Rewrite exotic LAST_VALUE/FIRST_VALUE to self-reference.

Open kgyrtkirk opened this issue 1 year ago • 0 comments

  • rewrite LAST_VALUE(x) OVER (ORDER BY y) to LAG(x,0) OVER (ORDER BY y)
    • the current LAST_VALUE logic has no idea about the frame itself; and doesn't care about the order by
  • not directly to x because some queries get unplannable that way
  • restrict NTILE from framing - as its not supported
  • add test to ensure that all of the KNOWN_WINDOW_FNS's framing is accounted for

Fixes #XXXX.

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:

  • [x] been self-reviewed.
    • [ ] using the concurrency checklist (Remove this item if the PR doesn't have any relation to concurrency.)
  • [ ] 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.

kgyrtkirk avatar Mar 06 '24 16:03 kgyrtkirk