1
votes

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!

1
Please consider filing a bug report (including the Flink version you are using). Thanks. - Fabian Hueske

1 Answers

2
votes

What you do describe was a bug that is described here.

It will be fixed in the next Flink version 1.5.0 that will be released next month.