Hi everyone, I am doing etl streaming data from ka...
# troubleshooting
h
Hi everyone, I am doing etl streaming data from kafka and enriching with some oracle database tables using flink SQL. Everything is fine with small and medium sized enrichment panels. But I have an enrichment table that has 10 million records, which makes the RAM memory provided to flink insufficient for execution. Currently my flink is still doing a full table scan and affecting performance. Suppose my table has partitions and I know which partition the enriched data is in, is there any way to solve this problem?
m
and I know which partition the enriched data is in
Maybe try to manually create a view in the database? Also for performance, have you defined the tables with "lookup.cache" option?
h
@Matan Perelmuter Thanks, I'll try 'lookup.cache'
@Matan Perelmuter I have a question. Does Flink re-scan the enrichment table periodically or just once. Suppose my enrich table has additional data, will that data be used to enrich the stream?
m
the documentation explains it pretty well:
The lookup cache is used to improve performance of temporal join the JDBC connector. By default, lookup cache is not enabled, so all the requests are sent to external database. When lookup cache is enabled, each process (i.e. TaskManager) will hold a cache. Flink will lookup the cache first, and only send requests to external database when cache missing, and update cache with the rows returned. The oldest rows in cache will be expired when the cache hit to the max cached rows
lookup.partial-cache.max-rows
or when the row exceeds the max time to live specified by
lookup.partial-cache.expire-after-write
or
lookup.partial-cache.expire-after-access
. The cached rows might not be the latest, users can tune expiration options to a smaller value to have a better fresh data, but this may increase the number of requests send to database. So this is a balance between throughput and correctness.
h
@Matan Perelmuter I tried using lookup cache and lookup join with the FOR SYSTEM_TIME AS OF statement but the results were not as expected. Flink only scans the oracle table once then FINISH. Please tell me what needs to be done to make flink read the oracle table again after some time?
m
I don't know, try to post minimal reproducible code and others might be able to help.
👍 1