-
Notifications
You must be signed in to change notification settings - Fork 2.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
Materialize: allow to work without destination PK #10160
Comments
@vitessio/vreplication |
I'm working on a related issue here: #10192 I wonder if I should fold this in... This specific failure occurs here: vitess/go/vt/vttablet/tabletmanager/vreplication/table_plan_builder.go Lines 545 to 577 in 39427bd
|
As I look into it more, now I'm wondering if this is not also fixed by #10192 as it looks like we use MoveTables for materializations. @derekperkins do you happen to have a simple test case, e.g. using the example commerce and customer keyspaces? I could then do some manual testing in my PR branch and I can go from there. |
After looking into this more it's orthogonal to #10192 so I won't be looping this into that work. |
I think this config should trigger the error Tablescreate table customer (
customer_id bigint not null auto_increment,
email varbinary(128),
primary key(customer_id)
);
create table customer_with_new_ids (
customer_id bigint not null auto_increment,
email varbinary(128),
primary key(customer_id)
); Materialize Config{
"workflow": "customer_with_new_ids",
"source_keyspace": "commerce",
"target_keyspace": "commerce",
"table_settings": [
{
"target_table": "customer_with_new_ids",
"source_expression": "select email from customer"
}
],
"tablet_types": "REPLICA"
} |
Noting that this is still an issue on main/18.0:
|
I'm materializing and summing from our raw usage table to a daily aggregate. I can't use a sequence to get a globally unique id, but a bounded unique id is sufficient for my use case, so I'm using auto-increment. I'm grouping on the source table columns to get a unique value, which works, but errors out if the PK on the target table is the autoinc value.
Materialize Config
Error Message
primary key column \u0026{usage_id bigint bigint true false} not found in select list
Destination Table Schema
Not urgent at all, and maybe there's a technical reason why the PK has to exist at the source table.
Tested on v13
The text was updated successfully, but these errors were encountered: