同じデータフレームの他のカラムに基づいて、指定されたデータフレームに新しいカラムを追加しようとしています。withColumnとcallUDFを使用してデータフレームにカラムを追加する
mapは文字列ブールマップです
以下は私のコードです。
hiveContext.udf().register("udfname", new UDF2<String, String, Boolean>() {
@Override
public Boolean call(String col1, String col2) throws Exception {
return map.get(col1+col2);
}
}, DataTypes.BooleanType);
DataFrame newDF = df.withColumn("newcol", calUDF("udfname" ,df.col("col1"),df.col("col2")));
コンパイルエラーです。
The method calUDF(String, Column, Column) is undefined for the type myclass
私は1.5.0を使用しています – user1544460