Hello! :wave: I attempting to perform a relativel...
# troubleshooting
j
Hello! πŸ‘‹ I attempting to perform a relatively simple
UNNEST
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? πŸ€”
Copy code
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;
Interestingly, FlinkSQL seems to be very sensitive to the size of the array. It processes 10 x 500-length-arrays per second very easily (~2% cpu usage) whereas 1 x 5000-length-arrays is too much (100% cpu usage)...