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: enable distsql_union, fix some issues #26368

Merged
merged 3 commits into from
Jun 4, 2018

Conversation

RaduBerinde
Copy link
Member

opt: fix two cases of errors caused by "inner" ORDER BY

When the ORDER BY adds columns to the scope, we want to remove these
columns before set operations, and for subqueries.

Release note: None

opt: fix set operations crash during exec

When building a set operation, we use the leftScope which might have
an ordering. This ordering must be discarded (it can refer to columns
that have been removed, causing a crash when we try to execbuild the
query).

Release note: None

opt: split distsql_union and enable for opt

The opt version of the planner test has some distsql plan differences;
they are mostly due to the optimizer ignoring inner ORDER BY (which
the planner doesn't).

Release note: None

@RaduBerinde RaduBerinde requested a review from a team as a code owner June 4, 2018 17:11
@RaduBerinde RaduBerinde requested a review from a team June 4, 2018 17:11
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@andy-kimball
Copy link
Contributor

Review status: 0 of 10 files reviewed at latest revision, all discussions resolved, some commit checks pending.


pkg/sql/opt/optbuilder/scope.go, line 53 at r1 (raw file):

	// In cases like (SELECT x FROM xy ORDER BY y), the scope only
	// contains x

Looks like you started down this path, and then abandoned it? It seems cleaner to use another scope, but did it turn out to be problematic?


Comments from Reviewable

When the `ORDER BY` adds columns to the scope, we want to remove these
columns before set operations, and for subqueries.

Release note: None
When building a set operation, we use the leftScope which might have
an ordering. This ordering must be discarded (it can refer to columns
that have been removed, causing a crash when we try to execbuild the
query).

Release note: None
The opt version of the planner test has some distsql plan differences;
they are mostly due to the optimizer ignoring inner ORDER BY (which
the planner doesn't).

Release note: None
@RaduBerinde
Copy link
Member Author

Review status: 0 of 10 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


pkg/sql/opt/optbuilder/scope.go, line 53 at r1 (raw file):

Previously, andy-kimball (Andy Kimball) wrote…

Looks like you started down this path, and then abandoned it? It seems cleaner to use another scope, but did it turn out to be problematic?

Oops, cleaned this up.

Yes, I tried to implement a separate scope and the change was getting pretty big and I became unsure of the approach. I figured I'd do the easy fix for now to enable the test and revisit later.


Comments from Reviewable

@andy-kimball
Copy link
Contributor

:lgtm:


Review status: 2 of 10 files reviewed at latest revision, 1 unresolved discussion, some commit checks pending.


Comments from Reviewable

@RaduBerinde
Copy link
Member Author

bors r+

craig bot pushed a commit that referenced this pull request Jun 4, 2018
26148: Makefile,pkg/ui: fix compilation of JS CCL protobufs r=couchand,mberhault a=benesch

Main commit message reproduced below, but there are two smaller commits as well.

---

PR #26040 introduced a dependency on CCL protobufs in the UI. The build
changes in that PR were slightly buggy; specifically, any protobuf that
was depended upon by both an OSS and CCL protobuf would be included in
the JavaScript bundle twice. This sort of double-inclusion causes subtle
problems, like the deepEqual in a unit test that suddenly started
failing [0].

To ensure only one copy of each protobuf is included, have the OSS and
CCL UI builds depend upon completely independent protobuf DLLs. The OSS
protobuf DLL includes only OSS protobufs, of course, while the CCL
protobuf DLL includes both the OSS and CCL protobufs. The protobuf
compiler, pbjs, takes care of including each dependent protobuf exactly
once.

To avoid creating a webpack configuration for each distribution and
distribution (i.e., webpack.protos.ccl.js and webpack.protos.oss.js),
use webpack's support for parameterized configs. For consistency,
collapse webpack.oss.js and webpack.ccl.js into a parameterized config
in webpack.app.js.

Additionally, deduplicate the Make rules that compile the CCL JavaScript
and TypeScript protobufs. The OSS and CCL rules are nearly identical, so
they can share a recipe with a little bit of Make magic.

[0]: https://github.com/cockroachdb/cockroach/pull/26040/files#diff-9c8c2f256576e5704513c79be1173f5cR452

26329: roachpb/client: remove LegacyRangeLookup and DeprecatedRangeLookupRequest r=nvanbenschoten a=nvanbenschoten

Cockroach 2.1 clusters will always support meta2 splits, so the legacy
range lookup approach is never allowable. No node in a 2.1 cluster will
send DeprecatedRangeLookupRequests either, so the code is no longer needed.

The change also removes the `DeprecatedReturnIntents` option on ScanRequests.
This option was a predecessor to the READ_UNCOMMITTED read consistency type.
It was only used in 1.1, so it no longer needs to be supported in 2.1 clusters.

26368: opt: enable distsql_union, fix some issues r=RaduBerinde a=RaduBerinde

#### opt: fix two cases of errors caused by "inner" ORDER BY

When the `ORDER BY` adds columns to the scope, we want to remove these
columns before set operations, and for subqueries.

Release note: None

#### opt: fix set operations crash during exec

When building a set operation, we use the leftScope which might have
an ordering. This ordering must be discarded (it can refer to columns
that have been removed, causing a crash when we try to execbuild the
query).

Release note: None

#### opt: split distsql_union and enable for opt

The opt version of the planner test has some distsql plan differences;
they are mostly due to the optimizer ignoring inner ORDER BY (which
the planner doesn't).

Release note: None


Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Co-authored-by: Radu Berinde <radu@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Jun 4, 2018

Build succeeded

@craig craig bot merged commit 2d4ad6c into cockroachdb:master Jun 4, 2018
@RaduBerinde RaduBerinde deleted the distsql_union branch July 31, 2018 18:46
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.

3 participants