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

sql: make DISTSQL option to EXPLAIN ANALYZE optional #31277

Merged
merged 1 commit into from Oct 11, 2018

Conversation

Projects
None yet
5 participants
@asubiotto
Contributor

asubiotto commented Oct 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)

@asubiotto asubiotto requested a review from jordanlewis Oct 11, 2018

@asubiotto asubiotto requested review from cockroachdb/sql-language-prs as code owners Oct 11, 2018

@cockroach-teamcity

This comment has been minimized.

Show comment
Hide comment
@cockroach-teamcity

cockroach-teamcity Oct 11, 2018

Member

This change is Reviewable

Member

cockroach-teamcity commented Oct 11, 2018

This change is Reviewable

@asubiotto

This comment has been minimized.

Show comment
Hide comment
@asubiotto
Contributor

asubiotto commented Oct 11, 2018

@asubiotto

This comment has been minimized.

Show comment
Hide comment
@asubiotto

asubiotto Oct 11, 2018

Contributor

Planning to backport to 2.1

Contributor

asubiotto commented Oct 11, 2018

Planning to backport to 2.1

@knz

knz approved these changes Oct 11, 2018

LGTM modulo test location

Show outdated Hide outdated pkg/sql/logictest/testdata/logic_test/explain_analyze Outdated
@jordanlewis

Outcome looks good, but have some implementation nits

Reviewable status: :shipit: 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).

@jseldess

This comment has been minimized.

Show comment
Hide comment
@jseldess

jseldess Oct 11, 2018

Contributor

Thanks, @asubiotto! cc @lhirata.

Contributor

jseldess commented Oct 11, 2018

Thanks, @asubiotto! cc @lhirata.

@knz

This comment has been minimized.

Show comment
Hide comment
@knz

knz Oct 11, 2018

Member

I disagree, the parser is the right place.

Member

knz commented Oct 11, 2018

I disagree, the parser is the right place.

@jordanlewis

This comment has been minimized.

Show comment
Hide comment
@jordanlewis

jordanlewis Oct 11, 2018

Member

I disagree, the parser is the right place.

Ok, overruled! LGTM if you add that parse test.

Member

jordanlewis commented Oct 11, 2018

I disagree, the parser is the right place.

Ok, overruled! LGTM if you add that parse test.

sql: make DISTSQL option to EXPLAIN ANALYZE optional
Reduce user surprise by not requiring a DISTSQL option in EXPLAIN
ANALYZE.

Release note (sql change): EXPLAIN ANALYZE <statement> is now a valid
equivalent of EXPLAIN ANALYZE (DISTSQL) <statement>
@asubiotto

Reviewable status: :shipit: 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 TestParse2 in parse_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

@asubiotto

This comment has been minimized.

Show comment
Hide comment
@asubiotto

asubiotto Oct 11, 2018

Contributor

bors r+

Contributor

asubiotto commented Oct 11, 2018

bors r+

craig bot pushed a commit that referenced this pull request Oct 11, 2018

Merge #31277
31277: sql: make DISTSQL option to EXPLAIN ANALYZE optional r=asubiotto a=asubiotto

Reduce user surprise by not requiring a DISTSQL option in EXPLAIN
ANALYZE.

Release note (sql change): EXPLAIN ANALYZE <statement> is now a valid
equivalent of EXPLAIN ANALYZE (DISTSQL) <statement>

Co-authored-by: Alfonso Subiotto Marqués <alfonso@cockroachlabs.com>
@craig

This comment has been minimized.

Show comment
Hide comment
@craig

craig bot commented Oct 11, 2018

Build succeeded

@craig craig bot merged commit a62a815 into cockroachdb:master Oct 11, 2018

3 checks passed

GitHub CI (Cockroach) TeamCity build finished
Details
bors Build succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@asubiotto asubiotto deleted the asubiotto:expanalyze branch Oct 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment