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

planner/cascades: Add ImplementationRule for Window #14085

Merged
merged 8 commits into from
Dec 19, 2019

Conversation

edytagarbarz
Copy link
Contributor

What problem does this PR solve?

Part of #13709
Add ImplementationRule for Window

@edytagarbarz edytagarbarz requested a review from a team as a code owner December 16, 2019 23:45
@ghost ghost requested review from alivxxx and winoros and removed request for a team December 16, 2019 23:45
}

// CalcCost implements Implementation CalcCost interface.
func (impl *WindowImpl) CalcCost(outCount float64, children ...memo.Implementation) float64 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consulted with @francis0407 . The Window cost is not included in the old planner and this is to be fixed later.

@zz-jason zz-jason added sig/planner SIG: Planner contribution This PR is from a community contributor. labels Dec 17, 2019
Copy link
Member

@francis0407 francis0407 left a comment

Choose a reason for hiding this comment

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

Could add a test case in the integration_test? You can just add a SQL which contains window function in testdata/integration_suite_in.json/TestSimplePlans, and then run go test with flag --record in cascades package.

planner/cascades/implementation_rules.go Outdated Show resolved Hide resolved
planner/cascades/implementation_rules.go Outdated Show resolved Hide resolved
planner/cascades/implementation_rules.go Outdated Show resolved Hide resolved
planner/cascades/implementation_rules.go Outdated Show resolved Hide resolved
planner/cascades/implementation_rules.go Outdated Show resolved Hide resolved
planner/cascades/implementation_rules.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Dec 17, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@21953f7). Click here to learn what that means.
The diff coverage is 100%.

@@             Coverage Diff             @@
##             master     #14085   +/-   ##
===========================================
  Coverage          ?   80.1752%           
===========================================
  Files             ?        483           
  Lines             ?     121510           
  Branches          ?          0           
===========================================
  Hits              ?      97421           
  Misses            ?      16334           
  Partials          ?       7755

Copy link
Member

@francis0407 francis0407 left a comment

Choose a reason for hiding this comment

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

LGTM.

var byItems []property.Item
byItems = append(byItems, lw.PartitionBy...)
byItems = append(byItems, lw.OrderBy...)
childProperty := &property.PhysicalProperty{ExpectedCnt: math.MaxFloat64, Items: byItems}
Copy link
Member

Choose a reason for hiding this comment

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

ExpectedCnt is also unused here, you can remove it.

@francis0407 francis0407 added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 17, 2019
Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

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

lgtm. Thanks for your contribution.
If there're some other parts of planner which you're interested in. Feel free to contact us on Github or community slack channel.

@alivxxx alivxxx added the status/can-merge Indicates a PR has been approved by a committer. label Dec 19, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Dec 19, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Dec 19, 2019

/run-all-tests

@sre-bot sre-bot merged commit 67422f4 into pingcap:master Dec 19, 2019
@edytagarbarz edytagarbarz deleted the ImplWindow branch December 19, 2019 11:36
XiaTianliang pushed a commit to XiaTianliang/tidb that referenced this pull request Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants