我在pig中定义自定义项时出错这是我的pig脚本:
REGISTER 'hdfs://localhost:54310/folder/myudf.jar';
DEFINE MYUD myudf.REDECODE();
当我执行第二行时,我得到这个错误消息
ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2998: Unhandled internal
error. myudf/REDECODE (wrong name: REDECODE)
我的自定义项功能:
import java.io.IOException;
import java.util.regex.Pattern;
import org.apache.pig.EvalFunc;
import org.apache.pig.data.Tuple;
import org.apache.pig.PigWarning;
import org.apache.pig.data.DataType;
import org.apache.pig.impl.util.WrappedIOException;
import org.apache.pig.impl.logicalLayer.schema.Schema;
public class REDECODE extends EvalFunc<String> {
...
}
请你帮我解决这个问题。
1条答案
按热度按时间2g32fytz1#
根据@badr注解,redecode类是在默认包中定义的,我们可以直接在脚本中使用redecode,或者如果我们需要redecode的简单别名,那么我们可以使用define和define别名并继续使用别名。