-
Notifications
You must be signed in to change notification settings - Fork 591
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
feat(frontend): define generated column on table/source with external schema #14644
Conversation
…hao/generated_column_in_create_source
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.
LGTM
@@ -80,6 +80,8 @@ macro_rules! impl_fmt_display { | |||
pub struct CreateSourceStatement { | |||
pub if_not_exists: bool, | |||
pub columns: Vec<ColumnDef>, | |||
// The wildchar position in columns defined in sql. Only exist when using external schema. |
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.
what doesexternal schema
refer to
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.
Schema from external connector
let has_items = !columns.is_empty() | ||
|| !constraints.is_empty() | ||
|| !watermarks.is_empty() | ||
|| wildcard_idx.is_some(); |
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.
do we store the *
's index in catalog?
Is it true that the columns on the left of *
means defined schema and on the right means generated columns.
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.
It will be in the sql string in catalog
Is it true that the columns on the left of * means defined schema and on the right means generated columns
No, * means all columns from external source
cols_from_sql.append(&mut cols_from_source); | ||
cols_from_sql.append(&mut cols_from_sql_r); | ||
Ok(cols_from_sql) | ||
} | ||
} else { | ||
// TODO(yuhao): https://github.com/risingwavelabs/risingwave/issues/12209 |
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.
nit: This TODO should be removed
this feature does not seem to work with Postgres CDC source create table courses (*) from pg_mydb table 'public.courses';
ERROR: Failed to run the query Caused by these errors (recent errors listed first):
1: gRPC request to meta service failed: Internal error
2: failed to validate CDC table
3: source cannot pass validation: INVALID_ARGUMENT: Primary key mismatch |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
close #12209
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
For table/source with schema from external connector, we use
*
to represent all columns from the external connector.Also we can define a generated column on able/source with an external connector.
example: