gpt4 book ai didi

Hadoop PIG Helper GROUP 错误

转载 作者:可可西里 更新时间:2023-11-01 16:33:41 26 4
gpt4 key购买 nike

我正在使用 Hortonworks Sandbox 1.2,我对 Hadoop 平台还很陌生。

所以这是错误,而我正在按照沙箱包含的教程进行操作。在 PIG 部分,我使用 PIG Helper 插入了 GROUP 代码。它插入一个代码,如

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

最佳答案

c = GROUP b BY all; 

不正确,正确的语法是

c = GROUP b all;

关于Hadoop PIG Helper GROUP 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17213576/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com