You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a table (two versions; one retaining existing VALUE_FORMAT of JSON, one changing to Avro) by joining two existing tables:
CREATE TABLE employee_t \
(key VARCHAR, \
name VARCHAR, \
watch_flag VARCHAR) \
WITH (KAFKA_TOPIC ='employees', \
VALUE_FORMAT ='JSON', \
KEY='key');
CREATE TABLE computer_t \
(comp_id INT, \
empkey VARCHAR, \
macaddr VARCHAR) \
WITH (KAFKA_TOPIC='computers', \
VALUE_FORMAT='JSON', \
KEY='empkey');
CREATE TABLE include_right_key AS \
SELECT e.key AS EMP_ID, \
e.NAME AS EMP_NAME, \
e.key AS EMP_KEY, \
c.macaddr AS MACADDR \
FROM computer_t c \
INNER JOIN employee_t e \
ON c.empkey = e.key ;
CREATE TABLE include_left_key AS \
SELECT c.empkey AS EMP_ID, \
e.NAME AS EMP_NAME, \
e.key AS EMP_KEY, \
c.macaddr AS MACADDR \
FROM computer_t c \
INNER JOIN employee_t e \
ON c.empkey = e.key ;
Inspect the key on the two source tables:
ksql> DESCRIBE EXTENDED COMPUTER_T;
Name : COMPUTER_T
Type : TABLE
Key field : EMPKEY
[...]
ksql> DESCRIBE EXTENDED EMPLOYEE_T;
Name : EMPLOYEE_T
Type : TABLE
Key field : KEY
[...]
Inspect the key on the created table.
Works, if the join key column from the left-side of the join is included:
ksql> DESCRIBE EXTENDED include_left_key;
Name : INCLUDE_LEFT_KEY
Type : TABLE
Key field : EMP_ID
[...]
Key not present, if only the join key column from the right-side of the join is included:
ksql> DESCRIBE EXTENDED include_right_key;
Name : INCLUDE_RIGHT_KEY
Type : TABLE
Key field :
[...]
The text was updated successfully, but these errors were encountered:
Create a table (two versions; one retaining existing
VALUE_FORMAT
of JSON, one changing to Avro) by joining two existing tables:Inspect the key on the two source tables:
Inspect the key on the created table.
Works, if the join key column from the left-side of the join is included:
Key not present, if only the join key column from the right-side of the join is included:
The text was updated successfully, but these errors were encountered: