0
我想從一個數據幀讀取列的值,並檢查該值是不是null,值的長度是< = 500我們如何檢查數據幀列的值是否爲空?
我的代碼:
import org.apache.spark.sql.functions._
object OmegaProcess
{
// Some scala lines of Code
....
val line_flag = generateomegaLineFlag(omegaDF)
def generateomegaLineFlag(omegaDF: DataFrame): Int = {
if (omegaDF("omega_file_name") != null && length(omegaDF("omega_file_name")) <= 500)
{
//Some Lines of code .....
}
100
}
}
但它不編譯,因爲下面的錯誤
Type mismatch expected :Boolean, actual: Column
有人能幫我解決這個問題嗎?