If you register a table and one of its fields is a map (extra
in this case“) the following statement works just fine:
SELECT f1, f2 FROM customers WHERE extra['sportPrefs'] = 'Football';
Now try to reference a key that does not exist in the map.
SELECT f1, f2 FROM customers WHERE extra['moviePrefs'] = 'Action';
You will get an NPE and the job exits. This would be OK if there was a way to check whether a particular key exists in a map. Unfortunately, I have not found a way. Check for IS NOT NULL
does not work. Without this feature maps in Flink SQL are pretty useless. What am I missing? Thanks!