Skip to content
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

opt: support view and sequence numeric refs #39062

Merged
merged 1 commit into from
Jul 29, 2019

Conversation

justinj
Copy link
Contributor

@justinj justinj commented Jul 23, 2019

I ended up complicating this much more than necessary - it turns out the
heuristic planner doesn't even support specifying columns for view
numeric references, so this feature is actually really straightforward.

I added a separate test file that is run under the heuristic planner as
well (the existing numeric reference test file panics when run under the
HP, concerningly...).

Release note: None

@justinj justinj requested review from rytaft and RaduBerinde July 23, 2019 22:51
@justinj justinj requested a review from a team as a code owner July 23, 2019 22:51
@justinj justinj requested a review from a team July 23, 2019 22:51
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @justinj, @RaduBerinde, and @rytaft)


pkg/sql/logictest/testdata/logic_test/numeric_references, line 13 at r1 (raw file):


statement error cannot specify an explicit column list when accessing a view by reference
SELECT * FROM [54(1) AS _]

you can use let to get the descriptor id and use that instead of hardcoding it (see https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/logictest/testdata/logic_test/prepare#L1030)

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 4 files at r1, 2 of 2 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @justinj)


pkg/sql/opt/testutils/testcat/test_catalog.go, line 159 at r2 (raw file):

			return ds, nil
		}
		if v, ok := ds.(*View); ok && v.ViewID == id {

is it worth having an ID() method in the DataSource interface that all of these implement?

@rytaft
Copy link
Collaborator

rytaft commented Jul 24, 2019


pkg/sql/opt/testutils/testcat/test_catalog.go, line 159 at r2 (raw file):

Previously, rytaft (Rebecca Taft) wrote…

is it worth having an ID() method in the DataSource interface that all of these implement?

Actually, Object already has that method, so you should be able to just use it.

@justinj
Copy link
Contributor Author

justinj commented Jul 25, 2019

TFTRs!

bors r+

@craig
Copy link
Contributor

craig bot commented Jul 25, 2019

Build failed

I ended up complicating this much more than necessary - it turns out the
heuristic planner doesn't even support specifying columns for view
numeric references, so this feature is actually really straightforward.

I added a separate test file that is run under the heuristic planner as
well (the existing numeric reference test file panics when run under the
HP, concerningly...).

Release note: None
@justinj
Copy link
Contributor Author

justinj commented Jul 29, 2019

bors r+

@craig
Copy link
Contributor

craig bot commented Jul 29, 2019

Build failed (retrying...)

craig bot pushed a commit that referenced this pull request Jul 29, 2019
39062: opt: support view and sequence numeric refs r=justinj a=justinj

I ended up complicating this much more than necessary - it turns out the
heuristic planner doesn't even support specifying columns for view
numeric references, so this feature is actually really straightforward.

I added a separate test file that is run under the heuristic planner as
well (the existing numeric reference test file panics when run under the
HP, concerningly...).

Release note: None

39147: opt: add rowsort to with-opt tests r=justinj a=justinj

Fixes #39112.

Thanks for finding @tbg!

Release note: None

Co-authored-by: Justin Jaffray <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jul 29, 2019

Build succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants