我有Scala代码,我正在使用udf,通过udf我正在做一些计算并得到它的状态并尝试相应地记录。我卡在其他部分,我无法打印控制台中的日志消息。
val testRule1 = { (code: Int, type: String, pCode: String) =>
if (code == 100 && type == "AK")
if (pCode != " " && pCode != Nil.toString())
true
else
{
validationMap("validation") = false
logger.info("Doing nor stuff")
false
}
else
valMap("val") = false
logger.info("Doing not stuff")
false
}
val valRule1Udf = udf(testRule1)
val valmasterDF = valChildDF.withColumn("valRow", valRule1Udf(valChildDF("TYPE"), valChildDF("P_CODE"))).drop("validatingRowVD")
答案 0 :(得分:0)
您的代码甚至无法编译
request.session_options[:expire_after] = 2.years
ActionController::Base.session_options[:expire_after] = 2.years
的变量,即保留关键字'AK'是type
,这应该是Char
String