I am trying to implement Null check. For e.g :
Col_A | Col_B | Col_C | Col_D
null | boy | null | dust
Then I want output as :
Col_A | Col_B | Col_C | Col_D | New_Col
null | boy | null | dust | Col_A failed null check
null | boy | null | dust | Col_D failed null check
What is the proper way to do this ?
select t.*
,concat(elt(e.pos+1,'Col_A','Col_B','Col_C','Col_D'),' failed null check') as New_Col
from mytable t lateral view posexplode (array(Col_A,Col_B,Col_C,Col_D)) e
where e.val is null
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments