kafka-tutorials icon indicating copy to clipboard operation
kafka-tutorials copied to clipboard

Replace `latest_by_offset` with `CREATE SOURCE TABLE`

Open ybyzek opened this issue 3 years ago • 1 comments

Porting https://github.com/confluentinc/ksqldb-recipes/issues/158 here

From @mjsax

Using latest_by_offset is outdated. We should use the new CREATE SOURCE TABLE instead.

See discussion in https://github.com/confluentinc/ksqldb-recipes/pull/144#discussion_r789872110

Just to add more color: there are for sure cases when latest_by_offset might still make sense. We should decide on a case-by-case basis.

Note to self: this is how one recipe was updated to use CREATE SOURCE TABLE: https://github.com/confluentinc/ksqldb-recipes/commit/a051ebdc1785bf8344f30161b7d9bd6689b4a25a

ybyzek avatar Feb 02 '22 18:02 ybyzek

Note, cannot use INSERT INTO when using CREATE SOURCE TABLE.

Better create the table for the topic and a second table as CT t2 AS SELECT * FROM t1

https://github.com/confluentinc/ksqldb-recipes/pull/144#discussion_r789872110

ybyzek avatar Mar 10 '22 15:03 ybyzek