I'm facing an unexpected behaviour on stream-stream join query result.
Situation
KSQL Version: 5.1.3
- There are 2 streams created from each kafka topic
#1.
CREATE STREAM streamA
(id VARCHAR)
WITH (KAFKA_TOPIC='topicA', VALUE_FORMAT='JSON');
#2.
CREATE STREAM streamB
(id VARCHAR,
date VARCHAR,
count INT)
WITH (KAFKA_TOPIC='topicB', VALUE_FORMAT='JSON')
- stream-stream join with creating kafka topic
CREATE STREAM streamC
WITH (KAFKA_TOPIC='topicC', VALUE_FORMAT='JSON', PARTITIONS=5) AS
SELECT b.id AS `id`,
b.date AS `date`,
b.count AS `count`
FROM streamB b
INNER JOIN streamA a WITHIN 1 DAY
on b.id = a.id;
Question
In this situation, when I make following 2 queries, one can get all info, but the other can't. Do you have some ideas why it happens or some problems on my queries?
Reference
Following queries returns expected result.
# OK
ksql> select a.id as `id`, a.date as `date`, a.count as `count` from streamA a inner join streamB b within 1 day on a.id = b.id;
# 00000001 | 2020-06-22 | 3
# OK
ksql> print 'topicC' from beginning;
# {"ROWTIME":1592804456184,"ROWKEY":"00000001","date":"2020-06-22","count":3}
However, following query returns unexpected one.
# NG
ksql> select * from streamC;
# 1592804456184 | 00000001 | null | null
# (expected result)
# 1592804456184 | 00000001 | 2020-06-22 | 3
Additional info
ksql> DESCRIBE streamC;
Name : STREAMC
Field | Type
-------------------------------------
ROWTIME | BIGINT (system)
ROWKEY | VARCHAR(STRING) (system)
date | VARCHAR(STRING)
count | INTEGER
-------------------------------------
For runtime statistics and query details run: DESCRIBE EXTENDED <Stream,Table>;