Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upsql: make DISTSQL option to EXPLAIN ANALYZE optional #31277
Conversation
asubiotto
requested a review
from
jordanlewis
Oct 11, 2018
asubiotto
requested review from
cockroachdb/sql-language-prs
as
code owners
Oct 11, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Planning to backport to 2.1 |
jordanlewis
approved these changes
Oct 11, 2018
Outcome looks good, but have some implementation nits
Reviewable status:
complete! 0 of 0 LGTMs obtained
pkg/sql/parser/sql.y, line 2237 at r1 (raw file):
| EXPLAIN ANALYZE preparable_stmt { $$.val = &tree.Explain{Options: []string{"DISTSQL", $2}, Statement: $3.stmt()}
I don't think this is right as I don't think the statement will roundtrip now - formatting this statement will be EXPLAIN ANALYZE (DISTSQL) instead of what it started as, just EXPLAIN ANALYZE. I think you should do this transformation later in the code, not in the parser.
Also you should add a parse roundtrip test for this (these live in parse_test.go).
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Thanks, @asubiotto! cc @lhirata. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I disagree, the parser is the right place. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jordanlewis
Oct 11, 2018
Member
I disagree, the parser is the right place.
Ok, overruled! LGTM if you add that parse test.
Ok, overruled! LGTM if you add that parse test. |
asubiotto
reviewed
Oct 11, 2018
Reviewable status:
complete! 0 of 0 LGTMs obtained
pkg/sql/logictest/testdata/logic_test/explain_analyze, line 14 at r1 (raw file):
Previously, knz (kena) wrote…
since this is an alias please put in in
TestParse2inparse_test.go
Done.
pkg/sql/parser/sql.y, line 2237 at r1 (raw file):
Previously, jordanlewis (Jordan Lewis) wrote…
I don't think this is right as I don't think the statement will roundtrip now - formatting this statement will be EXPLAIN ANALYZE (DISTSQL) instead of what it started as, just EXPLAIN ANALYZE. I think you should do this transformation later in the code, not in the parser.
Also you should add a parse roundtrip test for this (these live in parse_test.go).
Added to alias tests in TestParse2
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
bors r+ |
bot
pushed a commit
that referenced
this pull request
Oct 11, 2018
asubiotto
referenced this pull request
Oct 11, 2018
Merged
release-2.1: sql: make DISTSQL option to EXPLAIN ANALYZE optional #31278
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
craig
bot
commented
Oct 11, 2018
Build succeeded |
asubiotto commentedOct 11, 2018
Reduce user surprise by not requiring a DISTSQL option in EXPLAIN
ANALYZE.
Release note (sql change): EXPLAIN ANALYZE is now a valid
equivalent of EXPLAIN ANALYZE (DISTSQL)