【发布时间】:2017-04-23 12:04:03
【问题描述】:
我的 outputSchema 定义如下
public class Upper extends EvalFunc<Tuple> {
public Schema outputSchema(Schema schema) {
if(schema.size() < 2) {
log.info("--------------------Expecting two inputs.------------------------");
throw new RuntimeException("Expecting at least two inputs.");
}
.....
}
}
当我在我的代码中使用这个 EvalFunc 时
gen = foreach data generate upper(*);
Pig 抛出异常
2016-12-08 14:57:58,743 [main] ERROR org.apache.pig.PigServer - exception during parsing: Error during parsing. NULL Schema
Failed to parse: NULL Schema
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:201)
at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1735)
at org.apache.pig.PigServer$Graph.access$000(PigServer.java:1443)
at org.apache.pig.PigServer.parseAndBuild(PigServer.java:387)
at org.apache.pig.PigServer.executeBatch(PigServer.java:412)
at org.apache.pig.PigServer.executeBatch(PigServer.java:398)
at org.apache.pig.tools.grunt.GruntParser.executeBatch(GruntParser.java:171)
at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:749)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:376)
我不确定,当我传递整行时,猪如何将其视为空模式。
【问题讨论】:
标签: apache-pig schema udf