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.96k stars 3.79k forks source link

changefeedccl: elide SELECT * in changefeed expressions #84428

Open shermanCRL opened 2 years ago

shermanCRL commented 2 years ago

In changefeed expressions, a basic expression may look like:

CREATE CHANGEFEED INTO 'kafka://server'
AS SELECT * FROM foo
WHERE x > 2

It occurs to me that we can elide the SELECT * in the above example.

CREATE CHANGEFEED INTO 'kafka://server'
FOR foo    [or maybe FOR TABLE foo]
WHERE x > 2

I find this easier to read and write -- especially for a new user. If you simply want a filter, the expression is simple. [adage]

The existing syntax is clear, explicit and well-defined. My suggestion here is sugar, a reduction in verbosity. It’s analogous to eliding types by type inference.

Jira issue: CRDB-17654

Epic CRDB-21713

blathers-crl[bot] commented 2 years ago

cc @cockroachdb/cdc

amruss commented 2 years ago

Notes: We should be explicit about the syntax we want before launching