我似乎无法弄清楚我要去哪里错了。该脚本非常适用于 PigStorage,但为我提供了 CSVLoader 的 ClassCastException。
我检查了文档,但没有帮助。
这是堆栈跟踪:
Pig Stack Trace
---------------
ERROR 1200: Pig script failed to parse:
<file pig_script.pig, line 15, column 0> pig script failed to validate: java.lang.ClassCastException: org.apache.pig.piggybank.storage.CSVLoader cannot be cast to org.apache.pig.StoreFuncInterface
org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during parsing. Pig script failed to parse:
<file pig_script.pig, line 15, column 0> pig script failed to validate: java.lang.ClassCastException: org.apache.pig.piggybank.storage.CSVLoader cannot be cast to org.apache.pig.StoreFuncInterface
at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1597)
at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1540)
at org.apache.pig.PigServer.registerQuery(PigServer.java:540)
at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165)
at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
at org.apache.pig.Main.run(Main.java:555)
at org.apache.pig.Main.main(Main.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)