동일한 데이터 프레임의 다른 열을 기반으로 주어진 데이터 프레임에 새 열을 추가하려고합니다.withColumn과 callUDF를 사용하여 데이터 프레임에 열 추가
지도 다음은 내 코드 문자열 - 부울지도
입니다.
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