James Ramsay
04/11/2024, 8:14 AMUNNEST operation in Flink SQL. The job reads from one kafka topic, unnests an array and publishes to another topic.
The logic works as expected however the performance is awful! I have 1 message per second, each message has an array with 5,000 rows and the FlinkSQL job cannot keep up even with evenly distributed parallelism of 4.
Am I being unrealistic in my performance expectations, or is something very inefficient happening here? π€
CREATE TABLE source (
sensor_id STRING,
datapoints ARRAY<ROWdepth FLOAT, metric STRING, `value` FLOAT>,
event_timestamp TIMESTAMP(0) METADATA FROM 'timestamp'
) WITH (
'connector' = 'kafka',
...
);
INSERT INTO
sink
SELECT
dp.depth,
sensor_id,
dp.metric,
dp.`value`
FROM
source CROSS JOIN UNNEST(datapoints) AS dp;James Ramsay
04/11/2024, 11:11 AM