Hello Sir,
I’m trying to change an existing SQL “CASE WHEN … ELSE …” calculated column to implement in functional programming Scala 2.11.8 APIs…How do we implement this?
scenario 1:
case
when column1= o AND column2 = "XYX"
Then value
else 0 END
scenario 2:
CASE
when COALESCE(SUM(column1),0)= o AND COALESCE(SUM(column2),0) <> 0
THEN value
when COALESCE(SUM(column1),0) = 0 AND COALESCE(SUM(column2),0) = 0 THEN 0
*ELSE COALESCE(CAST(((SUM(column)/SUM(column))100) AS DECIMA(10,5),0)
END metrics
I have more number of CASE … WHEN statements.What is the equivalent of COALESCE in scala to check “not a number value” or null value for aggregating the column.
Is there any ABS() function available in scala?
How do we achieve these kind of metrics calculation using scala?.Please suggest me a idea on this proceed.
Thanks