Skip to content

Conversation

@jimexist
Copy link
Member

Which issue does this PR close?

Closes #592

Rationale for this change

turns out there's no need to rebase any exprs, removing the rebase would resolve the issue

What changes are included in this PR?

Are there any user-facing changes?

let sql = "SELECT order_id oid, MAX(order_id) OVER () max_oid, MAX(order_id) OVER () max_oid_dup from orders";
let expected = "\
Projection: #orders.order_id AS oid, #MAX(orders.order_id) AS max_oid, #MAX(orders.order_id) AS max_oid_dup\
\n WindowAggr: windowExpr=[[MAX(#orders.order_id)]]\
Copy link
Contributor

Choose a reason for hiding this comment

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

this is pretty cool that the planner has identified the redundancy and only computes MAX once 👍

Copy link
Member

Choose a reason for hiding this comment

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

not only the planner, the builder also does this for those who use the dataframe apis directly ;)

@jimexist jimexist force-pushed the fix-592 branch 3 times, most recently from ba3b290 to 4d0948b Compare June 24, 2021 00:26
@alamb alamb merged commit 8858d95 into apache:master Jun 24, 2021
@alamb
Copy link
Contributor

alamb commented Jun 24, 2021

Thanks @jimexist

@jimexist jimexist deleted the fix-592 branch June 24, 2021 15:51
@houqp houqp added the bug Something isn't working label Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix an issue where aliases are not respected in generating downstream schemas in window expr

3 participants