So I have a topic with stuff in it from CDC:
ksql> print 'mssqllatest.dbo.emp' from beginning;
Key format: JSON or HOPPING(KAFKA_STRING) or TUMBLING(KAFKA_STRING) or KAFKA_STRING
Value format: JSON or KAFKA_STRING
rowtime: 2022/07/03 01:14:24.666 Z, key: {"empno":2}, value: {"empno":2,"ename":"HARDING","job":"MANAGER","mgr":9,"hiredate":886377600000,"sal":"T1iA","comm":"dTA=","dept":3}, partition: 0
rowtime: 2022/07/03 01:14:24.667 Z, key: {"empno":3}, value: {"empno":3,"ename":"TAFT","job":"SALES I","mgr":2,"hiredate":820540800000,"sal":"JiWg","comm":"AMNQ","dept":3}, partition: 0
rowtime: 2022/07/03 01:14:24.667 Z, key: {"empno":4}, value: {"empno":4,"ename":"HOOVER","job":"SALES I","mgr":2,"hiredate":639014400000,"sal":"KTLg","comm":null,"dept":3}, partition: 0
rowtime: 2022/07/03 01:14:24.667 Z, key: {"empno":5}, value: {"empno":5,"ename":"LINCOLN","job":"TECH","mgr":6,"hiredate":772329600000,"sal":"IlUQ","comm":"AiLg","dept":4}, partition: 0
rowtime: 2022/07/03 01:14:24.667 Z, key: {"empno":6}, value: {"empno":6,"ename":"GARFIELD","job":"MANAGER","mgr":9,"hiredate":736214400000,"sal":"UmXA","comm":null,"dept":4}, partition: 0
rowtime: 2022/07/03 01:14:24.667 Z, key: {"empno":7}, value: {"empno":7,"ename":"POLK","job":"TECH","mgr":6,"hiredate":874886400000,"sal":"JiWg","comm":null,"dept":4}, partition: 0
And I tried creating a TABLE based off that topic and querying it, so I did this:
SET 'auto.offset.reset' = 'earliest';
CREATE TABLE t2_emp (empno INT PRIMARY KEY, ename VARCHAR, dept INT) WITH (KAFKA_TOPIC='mssqllatest.dbo.emp', VALUE_FORMAT='JSON');
CREATE TABLE q2_emp AS SELECT * FROM t2_emp;
Finally, I tried querying:
ksql> select * from q2_emp emit changes;
+------------------------------------+------------------------------------+------------------------------------+
|EMPNO |ENAME |DEPT |
+------------------------------------+------------------------------------+------------------------------------+
Nadaā¦ nothing thereā¦
Any ideas as to what Iām doing wrong?
Thanks!