I am trying to use a Snowflake column (which has functions like IFFNULL and IFF) in Spark dataframe. I have tried coalesce but its not working. Is there any equivalent function or logic to use in Spark dataframe?
Snowflake SQL:
SELECT P.Product_ID,
IFNULL(IFF(p1.ProductDesc='',NULL,p1.ProductDesc),
IFNULL(IFF(p2.PrdDesc='',NULL,p2.PrdDesc),IFF(p3.Product_Desc='',NULL,p3.Product_Desc))
) AS Product_Description
FROM Product p
LEFT JOIN Product_table_1 p1 ON p1.Product_ID = p.Product_ID
LEFT JOIN Product_table_2 p2 ON p2.Product_ID = p.Product_ID
LEFT JOIN Product_table_3 p3 ON p3.Product_ID = p.Product_ID
I tried: coalesce(p1.ProductDesc, p2.PrdDesc, p3.Product_Desc) but it is not working