Sample Header Ad - 728x90

Testing a Hive array for IS NULL says not null

0 votes
1 answer
6287 views
I have a table containing an array, and I want to check if it is empty or NULL. It appears that I cannot check the NULL directly! Can anyone shed light on why the NULL check isn't working? create table test_array_split ( campaign string , questions array ) stored as orc ; insert into test_array_split (campaign) values ('1'); select campaign , questions , size(questions) , case when questions is null then 'null' else 'not null' end isnull from test_array_split; +-----------+------------+------+-----------+ | campaign | questions | _c2 | isnull | +-----------+------------+------+-----------+ | 1 | NULL | -1 | not null | +-----------+------------+------+-----------+
Asked by PhilHibbs (539 rep)
Jul 24, 2020, 12:25 PM
Last activity: Sep 27, 2021, 08:03 PM