cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.87k stars 3.77k forks source link

changefeedccl: support for changefeeds with queries on tables with >1 family #127761

Open asg0451 opened 1 month ago

asg0451 commented 1 month ago

The following should work, but doesn't:

> create table cftest (id int primary key, data text, family f1 (id), family f2 (data));

>  CREATE CHANGEFEED INTO 'webhook-https://localhost:9090?insecure_tls_skip_verify=true' WITH updated, resolved, split_column_families as select data from cftest;

this creates a job, but it fails. logs:

W240726 18:22:28.811051 22049 ccl/changefeedccl/changefeed_stmt.go:1291 ⋮ [T1,Vsystem,n1,job=‹CHANGEFEED id=989422368960348161›] 441  Changefeed job 989422368960348161 encountered transient error: expressions can't reference columns from more than one column family (attempt 2)

this should work because the column that is selected is only one family's worth.

(without split_column_families option, the create fails with ERROR: CHANGEFEED targeting a table (cftest) with multiple column families requires WITH split_column_families and will emit multiple events per row.)

we should also document that this doesn't work currently in https://www.cockroachlabs.com/docs/v24.1/changefeeds-on-tables-with-column-families

Jira issue: CRDB-40585

blathers-crl[bot] commented 1 month ago

cc @cockroachdb/cdc

blathers-crl[bot] commented 1 month ago

Hi @asg0451, please add branch-* labels to identify which branch(es) this C-bug affects.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.