-
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: add 2pb logic and fix some bugs for partitionTopN #42334
Changes from all commits
00ee0f0
8beeb46
4d39b25
0c47963
2a23349
c37aa21
b71d1ae
92c8ff2
25ff0f0
4367fb5
dfaaf74
47dea1a
5c852b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -364,12 +364,14 @@ func (p *PhysicalSort) ExplainInfo() string { | |
|
||
// ExplainInfo implements Plan interface. | ||
func (p *PhysicalLimit) ExplainInfo() string { | ||
var str strings.Builder | ||
str.WriteString("offset:") | ||
str.WriteString(strconv.FormatUint(p.Offset, 10)) | ||
str.WriteString(", count:") | ||
str.WriteString(strconv.FormatUint(p.Count, 10)) | ||
return str.String() | ||
buffer := bytes.NewBufferString("") | ||
if len(p.GetPartitionBy()) > 0 { | ||
buffer = explainPartitionBy(buffer, p.GetPartitionBy(), false) | ||
fmt.Fprintf(buffer, ", offset:%v, count:%v", p.Offset, p.Count) | ||
} else { | ||
fmt.Fprintf(buffer, "offset:%v, count:%v", p.Offset, p.Count) | ||
} | ||
return buffer.String() | ||
} | ||
|
||
// ExplainInfo implements Plan interface. | ||
|
@@ -960,12 +962,14 @@ func (lt *LogicalTopN) ExplainInfo() string { | |
|
||
// ExplainInfo implements Plan interface. | ||
func (p *LogicalLimit) ExplainInfo() string { | ||
var str strings.Builder | ||
str.WriteString("offset:") | ||
str.WriteString(strconv.FormatUint(p.Offset, 10)) | ||
str.WriteString(", count:") | ||
str.WriteString(strconv.FormatUint(p.Count, 10)) | ||
return str.String() | ||
buffer := bytes.NewBufferString("") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. I think it is better to differentiate TopN with partition by calling it WindowTopN and do not include partition by fields. |
||
if len(p.GetPartitionBy()) > 0 { | ||
buffer = explainPartitionBy(buffer, p.GetPartitionBy(), false) | ||
fmt.Fprintf(buffer, ", offset:%v, count:%v", p.Offset, p.Count) | ||
} else { | ||
fmt.Fprintf(buffer, "offset:%v, count:%v", p.Offset, p.Count) | ||
} | ||
return buffer.String() | ||
} | ||
|
||
// ExplainInfo implements Plan interface. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,6 +163,7 @@ type LogicalJoin struct { | |
rightPreferJoinType uint | ||
|
||
EqualConditions []*expression.ScalarFunction | ||
// NAEQConditions means null aware equal conditions, which is used for null aware semi joins. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this related to this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this is the changes from #41763, I can remove it. |
||
NAEQConditions []*expression.ScalarFunction | ||
LeftConditions expression.CNFExprs | ||
RightConditions expression.CNFExprs | ||
|
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.
I think it is better to differentiate Limit with partition by calling it WindowLimit and do not include partition by fields.
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.
You mean adding a new
PhysicalWindowLimit
or just display asWindowLimit
in the explain info? Adding a newPhysicalWindowLimit
need a lots of changes, and I think we will miss the deadline if we wants to this :(