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
plan: implement ExplainInfo() interface for simple operators #3883
Conversation
@hanfei1991 @lamxTyler @winoros PTAL |
plan/physical_plans.go
Outdated
@@ -530,6 +530,18 @@ const ( | |||
CompleteAgg | |||
) | |||
|
|||
func (at AggregationType) String() string { |
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.
Add comment for the exported function.
Also, it seems that this function is not used?
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.
it is used by PhysicalAggregation.ExplainInfo()
executor/analyze_test.go
Outdated
@@ -52,7 +52,7 @@ func (s *testSuite) TestAnalyzeTable(c *C) { | |||
tk.MustExec("analyze table t1 index ind_a") | |||
result = tk.MustQuery("explain select * from t1 where t1.a = 1") | |||
rowStr = fmt.Sprintf("%s", result.Rows()) | |||
c.Check(strings.Split(rowStr, "{")[0], Equals, "[[TableScan_4 Selection_5 cop ] [Selection_5 cop ] [TableReader_6 root ]]") | |||
c.Check(strings.Split(rowStr, "{")[0], Equals, "[[TableScan_4 Selection_5 cop ] [Selection_5 cop eq(col(test.t1.a), const(1))] [TableReader_6 root ]]") |
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.
The Split
is unnecessary now, the same with line 42, 46.
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.
done
executor/analyze_test.go
Outdated
@@ -52,7 +52,7 @@ func (s *testSuite) TestAnalyzeTable(c *C) { | |||
tk.MustExec("analyze table t1 index ind_a") | |||
result = tk.MustQuery("explain select * from t1 where t1.a = 1") | |||
rowStr = fmt.Sprintf("%s", result.Rows()) | |||
c.Check(strings.Split(rowStr, "{")[0], Equals, "[[TableScan_4 Selection_5 cop ] [Selection_5 cop ] [TableReader_6 root ]]") | |||
c.Check(rowStr, Equals, "[[TableScan_4 Selection_5 cop ] [Selection_5 cop eq(col(test.t1.a), const(1))] [TableReader_6 root ]]") |
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 col(blabla..), constant(blabla...) is redundant...
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.
removed
@hanfei1991 @lamxTyler PTAL again |
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.
LGTM
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.
LGTM
to #3805