假设下面的case语句是在sql/txt文件中(下面的case语句只是示例,但实际用例有一个复杂的case语句,不能用在direct.withcolumn函数中)
case
when col1 = "INR" Then income"
when col 2= "eur" then "out"
else "passthroug"
end as trantype
我需要在下面的代码中调用上面的case语句sql,有没有自定义函数或者不同的调用方法
val tab = sparksession.table(db.table).withColumn("new colum", <need to call sql case statement file here>) Is there any option to call the sql file?
暂无答案!
目前还没有任何答案,快来回答吧!