Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

TPC-H: unsupported feature: HAVING #56

Closed
ajnavarro opened this issue Feb 27, 2018 · 3 comments · Fixed by #689
Closed

TPC-H: unsupported feature: HAVING #56

ajnavarro opened this issue Feb 27, 2018 · 3 comments · Fixed by #689
Assignees
Labels
enhancement New feature or request

Comments

@ajnavarro
Copy link
Contributor

Implement HAVING functionality: https://www.w3schools.com/sql/sql_having.asp

@ajnavarro ajnavarro added the enhancement New feature or request label Feb 27, 2018
@ajnavarro ajnavarro mentioned this issue Feb 27, 2018
14 tasks
@mcarmonaa mcarmonaa self-assigned this Mar 21, 2018
@mcarmonaa mcarmonaa added the blocked Some other issue is blocking this label Apr 3, 2018
@mcarmonaa
Copy link
Contributor

Stopped since this is not a priority in the OKRs

@andremarianiello
Copy link

Anyone have spare time to peek at this?

@erizocosmico erizocosmico removed the blocked Some other issue is blocking this label Jan 26, 2019
@erizocosmico
Copy link
Contributor

@andremarianiello sure! Sorry for the delay, didn't see the PR.

erizocosmico added a commit to erizocosmico/go-mysql-server that referenced this issue Apr 23, 2019
Closes src-d#56

This PR adds support for the HAVING SQL clause, that allows
filtering rows and has support for aggregation functions.

For this, the following changes have been made:
- New `Having` node, which is essentially a Filter, but it is
  a different node for the purpose of differentiating between the
  two of them during the analysis phase.
- Having is now parsed.
- A new rule for resolving the Having node has been added. Because
  of the way aggregations are executed (only inside a GroupBy node)
  it is not possible to execute them in any other node that's not a
  GroupBy. For this reason, this rule pushes down any aggregation
  on a Having node to its child, which is the GroupBy node. If
  the same aggregation is already done on the GroupBy, nothing will
  be added and the aggregation on the Having node will be replaced
  with a reference to the result of the aggregation in the GroupBy.
  Because pushing new aggregations to the GroupBy changes the
  resulting schema, a Project node is added wrapping the Having
  node projecting only the columns the GroupBy was initially
  projecting.

Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
erizocosmico added a commit to erizocosmico/go-mysql-server that referenced this issue Apr 24, 2019
Closes src-d#56

This PR adds support for the HAVING SQL clause, that allows
filtering rows and has support for aggregation functions.

For this, the following changes have been made:
- New `Having` node, which is essentially a Filter, but it is
  a different node for the purpose of differentiating between the
  two of them during the analysis phase.
- Having is now parsed.
- A new rule for resolving the Having node has been added. Because
  of the way aggregations are executed (only inside a GroupBy node)
  it is not possible to execute them in any other node that's not a
  GroupBy. For this reason, this rule pushes down any aggregation
  on a Having node to its child, which is the GroupBy node. If
  the same aggregation is already done on the GroupBy, nothing will
  be added and the aggregation on the Having node will be replaced
  with a reference to the result of the aggregation in the GroupBy.
  Because pushing new aggregations to the GroupBy changes the
  resulting schema, a Project node is added wrapping the Having
  node projecting only the columns the GroupBy was initially
  projecting.

Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
erizocosmico added a commit to erizocosmico/go-mysql-server that referenced this issue Apr 24, 2019
Closes src-d#56

This PR adds support for the HAVING SQL clause, that allows
filtering rows and has support for aggregation functions.

For this, the following changes have been made:
- New `Having` node, which is essentially a Filter, but it is
  a different node for the purpose of differentiating between the
  two of them during the analysis phase.
- Having is now parsed.
- A new rule for resolving the Having node has been added. Because
  of the way aggregations are executed (only inside a GroupBy node)
  it is not possible to execute them in any other node that's not a
  GroupBy. For this reason, this rule pushes down any aggregation
  on a Having node to its child, which is the GroupBy node. If
  the same aggregation is already done on the GroupBy, nothing will
  be added and the aggregation on the Having node will be replaced
  with a reference to the result of the aggregation in the GroupBy.
  Because pushing new aggregations to the GroupBy changes the
  resulting schema, a Project node is added wrapping the Having
  node projecting only the columns the GroupBy was initially
  projecting.

Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
4 participants