Hey everyone, I'm trying to test the batch capabil...
# troubleshooting
m
Hey everyone, I'm trying to test the batch capabilities of Flink, to see if we can use it to backfill historic data. I've defined a source and a print sink. I'm starting with simple grouping: count number of events per user per hour, running the next SQL:
Copy code
INSERT INTO console_sink
    SELECT window_start, window_end, user_id, count(user_id) as event_count
    FROM TABLE(
        TUMBLE(
            (SELECT * FROM events
            WHERE event_time > CURRENT_TIMESTAMP - interval '1' MONTH
            ORDER BY event_time
            limit 1000000
            ), 
            DESCRIPTOR(event_time), 
            INTERVAL '1' HOUR
        )
    )
    GROUP BY window_start, window_end, user_id
My goal is to test it against 300M rows, but the task manager is getting OOMed. I reduced it to 1M with no help. I've also tried to increase flink memory and I'm using RocksDB as state backend. Any ideas how to handle that? also what do you for batch jobs where the data is too large to fit in memory? (can't increase memory forever)
s
You might want to look at memory metrics to figure out exactly which memory OOMed. https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/memory/mem_setup_tm/ since there is a ORDER BY and RocksDB do make sure your managed memory is non zero for memory optimization wise, you can either use a smaller window or try to transform the data (not selecting *) to reduce the amount of memory loaded
m
@shikai ng Thanks! is it possible to configure Flink to use the disk as state memory?