Skip to content

sql,colexec: preliminary changes for wrapping LocalPlanNode#57644

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
yuzefovich:vec-wrap-local-base
Dec 8, 2020
Merged

sql,colexec: preliminary changes for wrapping LocalPlanNode#57644
craig[bot] merged 2 commits intocockroachdb:masterfrom
yuzefovich:vec-wrap-local-base

Conversation

@yuzefovich
Copy link
Copy Markdown
Member

sql: order the output of some SHOW queries deterministically

This commit modifies several internal queries for SHOW commands to make
the ordering of the output deterministic. The following had been
augmented:

  • SHOW PARTITIONS
  • SHOW CREATE
  • SHOW INDEXES
  • SHOW COLUMNS (this also had an addition of ORDER BY clause of
    array_agg that computes the set of indexes)
  • SHOW CONSTRAINTS.

Additionally, several logic tests were adjusted to use rowsort
directive when ORDER BY isn't specified in the query as well as some
EXPLAIN tests were moved into the execbuilder ones.

This work was prompted by the fact that the vectorized engine produces
the output for those queries with a different order (which is valid
given omitted ORDER BY clauses before) than the row-by-row engine.

Release note (sql change): Several SHOW commands have been adjusted to
enforce a particular ordering of the output rows.

colexec: use datum-backed type for Oids

Previously, we would use Int64 canonical type family to represents
Oids. However, such conversion is lossful because we're losing some
information (like semantic type and resolvable name), so if we were to
do columnarize -> materialize conversion on an Oid, we wouldn't get
the same thing back in the general case. To go around this issue this
commit switches Oid type family to be handled by the datum-backed type.
This will have some performance hit, but the queries with Oids aren't
expected to process a lot of data, so that hit could be safely ignored.

Release note: None

This commit modifies several internal queries for SHOW commands to make
the ordering of the output deterministic. The following had been
augmented:
- SHOW PARTITIONS
- SHOW CREATE
- SHOW INDEXES
- SHOW COLUMNS (this also had an addition of ORDER BY clause of
array_agg that computes the set of indexes)
- SHOW CONSTRAINTS.

Additionally, several logic tests were adjusted to use `rowsort`
directive when ORDER BY isn't specified in the query as well as some
EXPLAIN tests were moved into the execbuilder ones.

This work was prompted by the fact that the vectorized engine produces
the output for those queries with a different order (which is valid
given omitted ORDER BY clauses before) than the row-by-row engine.

Release note (sql change): Several SHOW commands have been adjusted to
enforce a particular ordering of the output rows.
Previously, we would use `Int64` canonical type family to represents
Oids. However, such conversion is lossful because we're losing some
information (like semantic type and resolvable name), so if we were to
do `columnarize -> materialize` conversion on an Oid, we wouldn't get
the same thing back in the general case. To go around this issue this
commit switches Oid type family to be handled by the datum-backed type.
This will have some performance hit, but the queries with Oids aren't
expected to process a lot of data, so that hit could be safely ignored.

Release note: None
@yuzefovich yuzefovich requested review from a team and asubiotto December 7, 2020 18:46
@yuzefovich yuzefovich requested a review from a team as a code owner December 7, 2020 18:46
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@asubiotto asubiotto 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 26 of 26 files at r1, 10 of 10 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@yuzefovich
Copy link
Copy Markdown
Member Author

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 8, 2020

Build succeeded:

@craig craig bot merged commit b7ef888 into cockroachdb:master Dec 8, 2020
@yuzefovich yuzefovich deleted the vec-wrap-local-base branch December 8, 2020 15:23
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