转载需注明出处:https://www.codelast.com/

查看本系列文章合集,请点击这里

运行Pig脚本时报错:

Error before Pig is launched
----------------------------
ERROR 2997: Encountered IOException. org.apache.pig.tools.parameters.ParseException: Encountered "<EOF>" at line 1, column 8.
Was expecting one of:
    <IDENTIFIER> ...
    <OTHER> ...
    <LITERAL> ...
    <SHELLCMD> ...
java.io.IOException: org.apache.pig.tools.parameters.ParseException: Encountered "<EOF>" at line 1, column 8.
Was expecting one of:
    <IDENTIFIER> ...
    <OTHER> ...
    <LITERAL> ...
    <SHELLCMD> ...
 
        at org.apache.pig.impl.PigContext.doParamSubstitution(PigContext.java:408)
        at org.apache.pig.Main.runParamPreprocessor(Main.java:783)
        at org.apache.pig.Main.run(Main.java:446)
        at org.apache.pig.Main.main(Main.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: org.apache.pig.tools.parameters.ParseException: Encountered "<EOF>" at line 1, column 8.
文章来源:https://www.codelast.com/
这个问题有可能有多种原因,比如某行漏写了语句结尾的分号。这里我遇到的是另一个原因:调用该Pig脚本的shell脚本,用 -p "xxx=$X" 这种形式传参时,参数为空,修正参数为空的问题即可解决。
[原创] Apache Pig问题:Encountered IOException. org.apache.pig.tools.parameters.ParseException: Encountered ""
Tagged on:         

发表评论

电子邮件地址不会被公开。 必填项已用*标注