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

Support for WINDOW clause #651

Closed
martint opened this issue Apr 19, 2019 · 3 comments · Fixed by #6192
Closed

Support for WINDOW clause #651

martint opened this issue Apr 19, 2019 · 3 comments · Fixed by #6192
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@martint
Copy link
Member

martint commented Apr 19, 2019

The syntax and semantics are described in section 7.15 of the SQL specification.

<table expression> ::=
  <from clause>
      [ <where clause> ]
      [ <group by clause> ]
      [ <having clause> ]
      [ <window clause> ]
<window clause> ::=
  WINDOW <window definition list>
<window definition list> ::=
  <window definition> [ { <comma> <window definition> }... ]
<window definition> ::=
  <new window name> AS <window specification>
<new window name> ::=
  <window name>
<window specification> ::=
  <left paren> <window specification details> <right paren>
<window specification details> ::=
  [ <existing window name> ]
      [ <window partition clause> ]
      [ <window order clause> ]
      [ <window frame clause> ]
<existing window name> ::=
  <window name>
<window function> ::=
  <window function type> OVER <window name or specification>
<window name or specification> ::=
    <window name>
  | <in-line window specification>
<in-line window specification> ::=
  <window specification>

This feature allows declaring a named window specification, which can then be used when calling window functions. It is useful to eliminate duplication when multiple window function invocations use the same window specification. The window specification can refer to other window specifications, allowing partial reuse.

Implementing this feature will require changing the parser, analyzer, and planner, but will not require any execution engine changes.

@electrum electrum added the enhancement New feature or request label Apr 19, 2019
@JamesRTaylor
Copy link

@Praveen2112 - is this still on your radar? FWIW, we'd love to see it implemented.

@Praveen2112
Copy link
Member

@JamesRTaylor Yes !! I'm working on it !! Parser part is completed , need to change the analyzer and planner for it

@JamesRTaylor
Copy link

Any update on this issue, @Praveen2112?

@kasiafi kasiafi self-assigned this Nov 17, 2020
@martint martint mentioned this issue Jan 26, 2021
10 tasks
@martint martint added this to the 352 milestone Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

5 participants