props/physical: add printing of PlanGrams#168346
props/physical: add printing of PlanGrams#168346trunk-io[bot] merged 2 commits intocockroachdb:masterfrom
Conversation
|
😎 Merged successfully - details. |
|
Detected infrastructure failure (matched: ). Automatically rerunning failed jobs. (run link) |
1 similar comment
|
Detected infrastructure failure (matched: ). Automatically rerunning failed jobs. (run link) |
DrewKimball
left a comment
There was a problem hiding this comment.
@DrewKimball reviewed 6 files and all commit messages, and made 1 comment.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on andyyang890 and ZhouXing19).
andyyang890
left a comment
There was a problem hiding this comment.
@andyyang890 made 3 comments.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on michae2 and ZhouXing19).
pkg/sql/opt/optgen/cmd/optgen/ops_gen.go line 78 at r1 (raw file):
for _, define := range g.sorted { fmt.Fprintf(&indexes, "%d, ", names.Len()) fmt.Fprint(&names, define.Name)
Is it maybe worth adding a linter or some kind of validation that the source names are all camel case already? IIUC there's an implicit assumption of that here. If there's already some validation, would you mind adding a comment explaining where the validation happens?
pkg/sql/opt/props/physical/plangram.go line 144 at r2 (raw file):
defer b.WriteRune('\n') } if p.root == nil {
nit: use p.Any() instead
pkg/sql/opt/props/physical/plangram.go line 164 at r2 (raw file):
return } switch t := term.(type) {
Should we have a default case for unexpected types?
To make plangrams look more like opt and canned opt plans, we want to use camel case operator names. Add a new function. Epic: None Release note: None
Add functions to print plangrams, and also clean up some of the structs and comments. Informs: cockroachdb#152053 Release note: None
michae2
left a comment
There was a problem hiding this comment.
TFTRs!
@michae2 made 4 comments and resolved 3 discussions.
Reviewable status:complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on DrewKimball and ZhouXing19).
pkg/sql/opt/optgen/cmd/optgen/ops_gen.go line 78 at r1 (raw file):
Previously, andyyang890 (Andy Yang) wrote…
Is it maybe worth adding a linter or some kind of validation that the source names are all camel case already? IIUC there's an implicit assumption of that here. If there's already some validation, would you mind adding a comment explaining where the validation happens?
Good point, added a test.
pkg/sql/opt/props/physical/plangram.go line 144 at r2 (raw file):
Previously, andyyang890 (Andy Yang) wrote…
nit: use p.Any() instead
Done.
pkg/sql/opt/props/physical/plangram.go line 164 at r2 (raw file):
Previously, andyyang890 (Andy Yang) wrote…
Should we have a default case for unexpected types?
Done.
|
Thanks for the reviews! /trunk merge |
opt: add Operator.CamelCase function
To make plangrams look more like opt and canned opt plans, we want to
use camel case operator names. Add a new function.
Epic: None
Release note: None
props/physical: add printing of PlanGrams
Add functions to print plangrams, and also clean up some of the structs
and comments.
Informs: #152053
Release note: None