-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Conversation
Will be cleaner once #38589 is merged. |
07db8f2
to
f276653
Compare
Done. |
pkg/sql/parser/sql.y
Outdated
{ | ||
$$.val = tree.NamedColumnQualification{Qualification: &tree.ColumnFamilyConstraint{Create: true}} | ||
} | ||
| CREATE IF NOT EXISTS FAMILY family_name |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
f276653
to
dc5ca38
Compare
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.
dc5ca38
to
3e0f26d
Compare
bors r+ |
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 <[email protected]> Co-authored-by: Tobias Schottdorf <[email protected]> Co-authored-by: Daniel Harrison <[email protected]> Co-authored-by: Yahor Yuzefovich <[email protected]>
Build succeeded |
closes #38906 |
Parameter updates Diagram updates Examples now use MovR Code PRs: cockroachdb/cockroach#38589 cockroachdb/cockroach#38904 Fixes #5190
Parameter updates Diagram updates Examples now use MovR Code PRs: cockroachdb/cockroach#38589 cockroachdb/cockroach#38904 Fixes #5190
Parameter updates Diagram updates Examples now use MovR Code PRs: cockroachdb/cockroach#38589 cockroachdb/cockroach#38904 Fixes #5190
Parameter updates Diagram updates Examples now use MovR New primary key example for partitioning Code PRs: cockroachdb/cockroach#38589 cockroachdb/cockroach#38904 Fixes #5190
Parameter updates Diagram updates Examples now use MovR New primary key example for partitioning Code PRs: cockroachdb/cockroach#38589 cockroachdb/cockroach#38904 Fixes #5190
This change introduces grammar to support user defined
column families in a CREATE TABLE ... AS query.