SELECT c.PROCESS_ID,
CASE WHEN c.PAYMODE = 'M'
THEN
CASE WHEN CURRENCY = 'USD'
THEN c.PREMIUM * c.RATE
ELSE c.PREMIUM END * 12
ELSE
CASE WHEN CURRENCY = 'USD'
THEN c.PREMIUM * c.RATE
ELSE c.PREMIUM END END VAlue
FROM CMM c
i want to convert sql query spark sql api how can i do?
thanks
registerTempTableand thensqlContext.sql("...")?