-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: support window function #8630
Merged
Merged
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
1aaf513
planner: support window function
alivxxx d8ebf09
Merge branch 'master' of github.com:pingcap/tidb into window
alivxxx 52d7513
Merge branch 'master' of github.com:pingcap/tidb into window
alivxxx db59bed
Merge branch 'master' of github.com:pingcap/tidb into window
alivxxx aaa2adf
Merge branch 'master' into window
zz-jason 6244626
address comments
alivxxx 1f077b8
Merge branch 'master' of github.com:pingcap/tidb into window
alivxxx f120ab9
Merge branch 'window' of github.com:lamxTyler/tidb into window
alivxxx 2b8d890
use latest parser
alivxxx 3095b2d
Merge branch 'master' of github.com:pingcap/tidb into window
alivxxx aa59c92
address comments
alivxxx eddbb79
Merge branch 'master' of github.com:pingcap/tidb into window
alivxxx 33e76f9
fix gofmt
alivxxx db13052
address comment
alivxxx ecf4ef8
address comments
alivxxx b3ad3d9
address comments
alivxxx 7e3e545
fix unit test
alivxxx aec7a2c
address comments
alivxxx 71bdea1
Merge branch 'master' into window
zz-jason b9b3366
add comment for build projection
alivxxx d047eb2
Merge branch 'window' of github.com:lamxTyler/tidb into window
alivxxx dcf8981
add more comments
alivxxx b2d293f
address comments
alivxxx 87e50ab
remove dot
alivxxx 2fd62ba
address comments
alivxxx 58de4fc
address comment
alivxxx 36c5993
update parser
alivxxx ccc13a4
Merge branch 'master' into window
alivxxx 5eb3e5b
Merge branch 'master' into window
eurekaka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2018 PingCAP, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package aggregation | ||
|
||
import ( | ||
"github.com/pingcap/tidb/expression" | ||
"github.com/pingcap/tidb/sessionctx" | ||
) | ||
|
||
// WindowFuncDesc describes a window function signature, only used in planner. | ||
type WindowFuncDesc struct { | ||
baseFuncDesc | ||
} | ||
|
||
// NewWindowFuncDesc creates a window function signature descriptor. | ||
func NewWindowFuncDesc(ctx sessionctx.Context, name string, args []expression.Expression) *WindowFuncDesc { | ||
return &WindowFuncDesc{newBaseFuncDesc(ctx, name, args)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it belong to aggregation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the package name to
udf
or something else?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to, window function is also a kind of aggregate function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But its behavior is quite different with normal aggregate function since it won't make the rows grouped into one though there's
OVER
clause.I think they should be in the same level not superior-subordinate.