In spark 1.4.1, the parameter of callUdf method is
(String udfName, scala.collection.Seq<Column> cols)
There is no method that can act to column directly, like method in 1.5.1
callUDF(String udfName, Column col)
So how to call UDF in 1.4.1? Or how to change column type to
scala.collection.Seq<Column>
For example, these codes work in 1.6.1
sqlContext.udf().register("stringToLong", new UDF1<String, Long>() {
@Override
public Long call(String arg0) throws Exception {
// TODO Auto-generated method stub
IPTypeConvert itc = new IPTypeConvert();
return itc.stringtoLong(arg0);
}
}, DataTypes.LongType);
DataFrame interDF = initInterDF.withColumn("interIPInt", callUDF("stringToLong", initInterDF.col("interIP")));
How should I change the codes so that they can work in spark 1.4.1?