【发布时间】:2016-08-06 02:52:22
【问题描述】:
以下是由双冒号 (::) 分隔的示例数据集。
1::Toy Story (1995)::Animation|Children's|Comedy
我想从上述数据集中提取三个字段,分别是电影 ID、标题和流派。我为此编写了以下代码
movies = LOAD 'location/of/dataset/on/hdfs '
using PigStorage('::')
as
(MovieID:int,title:chararray,genre:chararray);
但我收到以下错误
ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Pig script failed to parse:
<file script.pig, line 1, column 9> pig script failed to validate:
java.lang.RuntimeException: could not instantiate 'PigStorage' with arguments '[::]'
【问题讨论】:
-
社区recently discussed ASAP begging,并坚决同意这是不可接受的。请不要将此添加到您的问题中。
-
当您使用 PigStorage 加载数据时,它只需要单个字符作为分隔符。
标签: apache-pig