'How to filter out NULLs in a Hive query?

Table is:

enter image description here

Result should be:

enter image description here

How can I solve this query?

hive\> select \* from xyz;
OK
xyz.col1    xyz.col2    xyz.col3
NULL    b   c
a   NULL    c
a   b   NULL
Time taken: 0.165 seconds, Fetched: 3 row(s)


Solution 1:[1]

SELECT MAX(COL1)AS COL1,MAX(COL2)AS COL2,MAX(COL3)AS COL3
FROM YOUR_TABLE

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sergey