0

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!

Fabian Hueske
  • 18,707
  • 2
  • 44
  • 49

1 Answers1

2

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.

twalthr
  • 2,584
  • 16
  • 15