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

parser: Add user defined column families to CTAS. #38904

Merged
merged 1 commit into from
Jul 18, 2019

Conversation

adityamaru27
Copy link
Contributor

This change introduces grammar to support user defined
column families in a CREATE TABLE ... AS query.

@adityamaru27 adityamaru27 requested review from dt and a team July 16, 2019 18:26
@adityamaru27 adityamaru27 requested a review from a team as a code owner July 16, 2019 18:26
@adityamaru27 adityamaru27 requested review from a team July 16, 2019 18:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@adityamaru27
Copy link
Contributor Author

Will be cleaner once #38589 is merged.

@adityamaru27
Copy link
Contributor Author

Will be cleaner once #38589 is merged.

Done.

{
$$.val = tree.NamedColumnQualification{Qualification: &tree.ColumnFamilyConstraint{Create: true}}
}
| CREATE IF NOT EXISTS FAMILY family_name
Copy link
Member

Choose a reason for hiding this comment

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

I’m kinda surprised we need all these extra syntaxes — we’re creating a new table so create and in particular ifnotexists seem implied? I donno I don’t feel strongly about it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rolandcrosby do you have any inputs on this? This is w.r.t what column qualifiers we support when grouping into a FAMILY. I agree with David, I just copy-pasted from the qualifiers CREATE and ALTER support.

Choose a reason for hiding this comment

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

yeah I would just support the "FAMILY" syntax in CTAS; don't think there's any reason to complicate things by adding redundant "create" or "if not exists" qualifiers for column families here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

This change introduces grammar to support user defined
column families. We are able to entirely piggyback on
the existing CREATE TABLE logic handling this, and thus
there are no changes outside of `pkg/parser`.
Added logic tests to verify behavior.

Release note (sql change): CREATE TABLE ... AS allows user defined
column families.
@adityamaru27
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Jul 18, 2019
38904: parser: Add user defined column families to CTAS. r=adityamaru27 a=adityamaru27

This change introduces grammar to support user defined
column families in a CREATE TABLE ... AS query.

38913: deps: bump go.etcd.io/etcd r=tbg a=danhhz

To pick up etcd-io/etcd#10864.

Release note: None

38972: exec: fix calculation of selectivity stat when num batches is zero r=yuzefovich a=yuzefovich

Release note: None

Co-authored-by: Aditya Maru <adityamaru@cockroachlabs.com>
Co-authored-by: Tobias Schottdorf <tobias.schottdorf@gmail.com>
Co-authored-by: Daniel Harrison <daniel.harrison@gmail.com>
Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Jul 18, 2019

Build succeeded

@craig craig bot merged commit 3e0f26d into cockroachdb:master Jul 18, 2019
@adityamaru27 adityamaru27 deleted the ctas-add-col-family branch July 18, 2019 21:59
@adityamaru27
Copy link
Contributor Author

closes #38906

ericharmeling added a commit to cockroachdb/docs that referenced this pull request Aug 21, 2019
Parameter updates
Diagram updates
Examples now use MovR

Code PRs:
cockroachdb/cockroach#38589
cockroachdb/cockroach#38904

Fixes #5190
ericharmeling added a commit to cockroachdb/docs that referenced this pull request Aug 21, 2019
Parameter updates
Diagram updates
Examples now use MovR

Code PRs:
cockroachdb/cockroach#38589
cockroachdb/cockroach#38904

Fixes #5190
ericharmeling added a commit to cockroachdb/docs that referenced this pull request Aug 26, 2019
Parameter updates
Diagram updates
Examples now use MovR

Code PRs:
cockroachdb/cockroach#38589
cockroachdb/cockroach#38904

Fixes #5190
ericharmeling added a commit to cockroachdb/docs that referenced this pull request Aug 26, 2019
Parameter updates
Diagram updates
Examples now use MovR
New primary key example for partitioning

Code PRs:
cockroachdb/cockroach#38589
cockroachdb/cockroach#38904

Fixes #5190
ericharmeling added a commit to cockroachdb/docs that referenced this pull request Aug 28, 2019
Parameter updates
Diagram updates
Examples now use MovR
New primary key example for partitioning

Code PRs:
cockroachdb/cockroach#38589
cockroachdb/cockroach#38904

Fixes #5190
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