-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[YSQL] Colocation: Create table partition fails with colocation option #20302
Labels
Comments
Note: We support creating individual partitions as colocated or non-colocated via CREATE + ATTACH:
However, if we try to use |
yifanguan
added a commit
that referenced
this issue
Mar 19, 2024
…ewrite and table partition Summary: This diff fixes two issues of the colocation option in table creation. (1) Table rewrite YB table rewrite operations like ALTER TABLE ADD PRIMARY KEY and REFRESH MATERIALIZED VIEW create a new YB table under the hood. `reloptions` field in `pg_class` catalog table is read to maintain the property of tables. Option value in `reloptions` syntax like `colocation=0` is parsed as integer type by the PG parser, but when untransformed from `reloptions` field, its type is string. To solve this issue, extend function `defGetBoolean` to process string `0` and `1` as false and true, respectively. (2) Table partition We have a check to prevent tablegroup from using with colocation option mainly serving as a grammar guard, and this check is placed in an inappropriate place causing table partition creation to fail when the colocation option is specified. Solve this issue by moving the check to an earlier place in the CREATE TABLE execution path. Jira: DB-9268, DB-9896 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressColocation' Reviewers: tverona, fizaa Reviewed By: fizaa Subscribers: yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D33001
yifanguan
added a commit
that referenced
this issue
Apr 2, 2024
…elated to table rewrite and table partition Summary: This diff fixes two issues of the colocation option in table creation. (1) Table rewrite YB table rewrite operations like ALTER TABLE ADD PRIMARY KEY and REFRESH MATERIALIZED VIEW create a new YB table under the hood. `reloptions` field in `pg_class` catalog table is read to maintain the property of tables. Option value in `reloptions` syntax like `colocation=0` is parsed as integer type by the PG parser, but when untransformed from `reloptions` field, its type is string. To solve this issue, extend function `defGetBoolean` to process string `0` and `1` as false and true, respectively. (2) Table partition We have a check to prevent tablegroup from using with colocation option mainly serving as a grammar guard, and this check is placed in an inappropriate place causing table partition creation to fail when the colocation option is specified. Solve this issue by moving the check to an earlier place in the CREATE TABLE execution path. Jira: DB-9268, DB-9896 Original commit: 2cbb49d / D33001 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressColocation' Reviewers: tverona, fizaa Reviewed By: fizaa Subscribers: yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D33344
yifanguan
added a commit
that referenced
this issue
Apr 2, 2024
…ated to table rewrite and table partition Summary: This diff fixes two issues of the colocation option in table creation. (1) Table rewrite YB table rewrite operations like ALTER TABLE ADD PRIMARY KEY and REFRESH MATERIALIZED VIEW create a new YB table under the hood. `reloptions` field in `pg_class` catalog table is read to maintain the property of tables. Option value in `reloptions` syntax like `colocation=0` is parsed as integer type by the PG parser, but when untransformed from `reloptions` field, its type is string. To solve this issue, extend function `defGetBoolean` to process string `0` and `1` as false and true, respectively. (2) Table partition We have a check to prevent tablegroup from using with colocation option mainly serving as a grammar guard, and this check is placed in an inappropriate place causing table partition creation to fail when the colocation option is specified. Solve this issue by moving the check to an earlier place in the CREATE TABLE execution path. Jira: DB-9268, DB-9896 Original commit: 2cbb49d / D33001 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressColocation' Reviewers: tverona, fizaa Reviewed By: fizaa Subscribers: yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D33348
yifanguan
added a commit
that referenced
this issue
Apr 2, 2024
…ated to table rewrite and table partition Summary: This diff fixes two issues of the colocation option in table creation. (1) Table rewrite YB table rewrite operations like ALTER TABLE ADD PRIMARY KEY and REFRESH MATERIALIZED VIEW create a new YB table under the hood. `reloptions` field in `pg_class` catalog table is read to maintain the property of tables. Option value in `reloptions` syntax like `colocation=0` is parsed as integer type by the PG parser, but when untransformed from `reloptions` field, its type is string. To solve this issue, extend function `defGetBoolean` to process string `0` and `1` as false and true, respectively. (2) Table partition We have a check to prevent tablegroup from using with colocation option mainly serving as a grammar guard, and this check is placed in an inappropriate place causing table partition creation to fail when the colocation option is specified. Solve this issue by moving the check to an earlier place in the CREATE TABLE execution path. Jira: DB-9268, DB-9896 Original commit: 2cbb49d / D33001 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressColocation' Reviewers: tverona, fizaa Reviewed By: fizaa Subscribers: yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D33346
Issue resolved by commit 2cbb49d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Jira Link: DB-9268
Description
For colocation,
CREATE <table> PARTITION OF ... WITH (COLOCATION=FALSE/TRUE)
fails.Example:
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: