hadoop pig helper组错误

a64a0gku  于 2021-06-04  发布在  Hadoop
关注(0)|答案(2)|浏览(239)

我正在使用hortonworkssandbox1.2,我对hadoop平台还很陌生。
所以这里是错误,当我遵循沙盒包含的教程时。在pig部分,我使用pig helper插入了组代码。它插入了一个类似

GROUP %VAR% BY %VAR%

完成教程后,我的代码看起来是这样的。

a = LOAD 'nyse_stocks' USING org.apache.hcatalog.pig.HCatLoader();
b = FILTER a BY stock_symbol == 'IBM';
c = GROUP b BY all;
d = FOREACH c GENERATE AVG(b.stock_volume);
DUMP d;

错误如下:

[main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: mismatched input ';' expecting LEFT_PAREN

我做的每件事都像教程里说的那样。那么错误在哪里呢?
编辑:我添加了Pig日志如下。

2013-06-24 04:56:16,869 [main] INFO org.apache.pig.Main - Apache Pig version 0.10.1.21 (rexported) compiled Dec 24 2012, 03:01:24
2013-06-24 04:56:16,870 [main] INFO org.apache.pig.Main - Logging error messages to: /hadoop/mapred/taskTracker/sandbox/jobcache/job_201306240450_0001/attempt_201306240450_0001_m_000000_0/work/pig_1372064176867.log
2013-06-24 04:56:20,224 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: hdfs://sandbox:8020
2013-06-24 04:56:22,862 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to map-reduce job tracker at: sandbox:50300
2013-06-24 04:56:25,672 [main] WARN org.apache.hadoop.hive.conf.HiveConf - DEPRECATED: Configuration property hive.metastore.local no longer has any effect. Make sure to provide a valid value for hive.metastore.uris if you are connecting to a remote metastore.
2013-06-24 04:56:25,959 [main] INFO hive.metastore - Trying to connect to metastore with URI thrift://sandbox:9083
2013-06-24 04:56:27,956 [main] INFO hive.metastore - Waiting 1 seconds before next connection attempt.
2013-06-24 04:56:28,957 [main] INFO hive.metastore - Connected to metastore.
2013-06-24 04:56:30,552 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: mismatched input ';' expecting LEFT_PAREN
Details at logfile: /hadoop/mapred/taskTracker/sandbox/jobcache/job_201306240450_0001/attempt_201306240450_0001_m_000000
xqnpmsa8

xqnpmsa81#

c = GROUP b BY all;

不正确,语法正确

c = GROUP b all;
li9yvcax

li9yvcax2#

按照这个链接看第4步,上面提到的例子解释了在pig中执行“group”的正确方法
链接:(http://hortonworks.com/hadoop-tutorial/hello-world-an-introduction-to-hadoop-hcatalog-hive-and-pig/#pig)

相关问题