我无法从 foreach 中调用宏,例如
DEFINE valid_attribute(id,attribute)
RETURNS result {
data = LOAD '/user/sathish/sessAttr' AS (id:chararray,browser_version:chararray);
filtered_data = FILTER data BY id == '$id' AND $attribute is NOT null;
$result = foreach filtered_data generate $attribute;
};
ip = load '/user/sathish/macros/inputParams' AS (id:chararray,attribute:chararray);
op = foreach ip {generate valid_attribute('ip::id','ip:attribute');};
dump op;
调用相同时出现以下异常:
2013-06-25 04:47:42,239 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve valid_attribute using imports: [, org.apache.pig.builtin., org.apache.pig.impl.builtin.]