我试图在一个子字符串函数中使用长度函数,DataFrame
但它给出了错误
val substrDF = testDF.withColumn("newcol", substring($"col", 1, length($"col")-1))
Run Code Online (Sandbox Code Playgroud)
以下是错误
error: type mismatch;
found : org.apache.spark.sql.Column
required: Int
Run Code Online (Sandbox Code Playgroud)
我正在使用2.1.