Pig version:
[root@n8 examples]# pig -version Apache Pig version 0.11.0-cdh4.3.0 (rexported) compiled May 27 2013, 20:48:21
Hadoop version:
[root@n8 examples]# hadoop version Hadoop 2.0.0-cdh4.3.0 Subversion file:///data/1/jenkins/workspace/generic-package-rhel64-6-0/topdir/BUILD/hadoop-2.0.0-cdh4.3.0/src/hadoop-common-project/hadoop-common -r 48a9315b342ca16de92fcc5be95ae3650629155a Compiled by jenkins on Mon May 27 19:45:25 PDT 2013 From source with checksum a4218d77f9b12df4e3e49ef96f9d357d This command was run using /opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/lib/hadoop/hadoop-common-2.0.0-cdh4.3.0.jar
Try to run below Pig script
define dividend_analysis (daily, year, daily_symbol, daily_open, daily_close) returns analyzed { divs = load 'NYSE_dividends' as (exchange:chararray, symbol:chararray, date:chararray, dividends:float); divsthisyear = filter divs by date matches '$year-.*'; dailythisyear = filter $daily by date matches '$year-.*'; jnd = join divsthisyear by symbol, dailythisyear by $daily_symbol; $analyzed = foreach jnd generate dailythisyear::$daily_symbol, $daily_close - $daily_open; }; daily = load 'NYSE_daily' as (exchange:chararray, symbol:chararray, date:chararray, open:float, high:float, low:float, close:float, volume:int, adj_close:float); results = dividend_analysis(daily, '2009', 'symbol', 'open', 'close'); dump results;
Error info as follows
grunt> exec ch6/macro.pig 2013-08-16 19:39:17,936 [main] WARN org.apache.hadoop.conf.Configuration - fs.default.name is deprecated. Instead, use fs.defaultFS 2013-08-16 19:39:17,937 [main] WARN org.apache.hadoop.conf.Configuration - dfs.https.address is deprecated. Instead, use dfs.namenode.https-address 2013-08-16 19:39:17,937 [main] WARN org.apache.hadoop.conf.Configuration - io.bytes.per.checksum is deprecated. Instead, use dfs.bytes-per-checksum <line 21, column 53> Unexpected character '$' 2013-08-16 19:39:17,943 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <line 21, column 53> Unexpected character '$' Details at logfile: /root/git/programmingpig/examples/pig_1376647314921.log
The error happen in this line
$analyzed = foreach jnd generate dailythisyear::$daily_symbol, $daily_close - $daily_open;
Now sure why this error happen for now, pig version?? Apparently we have to use the prefix 'dailythisyear::' here because both datasets have one field names symbol. If I remove the prefix and run again, the error will be:
2013-08-16 19:33:10,570 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1025: at expanding macro 'dividend_analysis' (null:24) <line 19, column 43> Invalid field projection. Projected field [symbol] does not exist in schema: macro_dividend_analysis_divsthisyear_0::exchange:chararray,macro_dividend_analysis_divsthisyear_0::symbol:chararray,macro_dividend_analysis_divsthisyear_0::date:chararray,macro_dividend_analysis_divsthisyear_0::dividends:float,macro_dividend_analysis_dailythisyear_0::exchange:chararray,macro_dividend_analysis_dailythisyear_0::symbol:chararray,macro_dividend_analysis_dailythisyear_0::date:chararray,macro_dividend_analysis_dailythisyear_0::open:float,macro_dividend_analysis_dailythisyear_0::high:float,macro_dividend_analysis_dailythisyear_0::low:float,macro_dividend_analysis_dailythisyear_0::close:float,macro_dividend_analysis_dailythisyear_0::volume:int,macro_dividend_analysis_dailythisyear_0::adj_close:float. Details at logfile: /root/git/programmingpig/examples/pig_1376647314921.log
相关推荐
Hypermill 5 Axis- Automatic Creat to Multi Blade toolpaths with Macro.mkv
CATIA V5 Macro Programming with Visual Basic Script
Excel Macro to Generate Database Insert Script Excel宏生成数据库插入脚本 对于开发人员来说,一次在数据库中添加/编辑主数据或静态数据一直很麻烦,因为它需要为每个小的文本更改集编写脚本。 对于不了解SQL...
Carpenter's Complete Guide to the SAS Macro Language
macro to update iso windows 7 to last update
source insight常用macro语言脚本,加速你的代码编写。很多功能都是很实用的,比如快速注解、取消注解多行代码功能
Macro F1 and Macro F1是2019年的一篇关于两种宏观F1-score的计算方式的详细讲解。
好用 的 excel macro,可以build好用 的 excel macro,可以build好用 的 excel macro,可以build好用 的 excel macro,可以build
.Introduction to the Macro Facility 3 Chapter 2. . . . . . . . . .SAS Programs and Macro Processing 11 Chapter 3. . . . . . . . . .Macro Variables 19 Chapter 4. . . . . . . . . .Macro Processing 33 ...
i. You open the DPHU_Format_26Dec.xls, then apply DPHU_Match, after the program starts to run, you select the after-meeting test report from which you want to generate a dphu report. ii. Use “Save ...
FreeMarker使用Macro实例,很好的学习资料。
清理Macro1残余提示 Macro1Macro1Macro1
[confluence插件] confluence-markdown-macro-1.6.22.jar [confluence插件] confluence-markdown-macro-1.6.22.jar [confluence插件] confluence-markdown-macro-1.6.22.jar [confluence插件] confluence-markdown-...
Run mvn clean package to create the plugin .hpi file. To install: 1. copy the resulting ./target/credentials.hpi file to the $JENKINS_HOME/plugins directory. Don't forget to restart Jenkins ...
catia macro with top ten, so beatiful
sas macro language in PDF format
Macro Recorder Macro Recorder - the best macro... Not just a keyboard and mouse recorder but a powerful automation tool that converts macros to EXE files and more. http://www.jitbit.com/macro-recorder/
Or you can create scripts, encrypt them and then decrypt them at run-time so that only a number of limited people can script for your program. Allowing the end-user to modify your program, gives your...
Macro工具(或图标或快捷键)制作完成,建议将自己习惯的一些操作作成自定义工具,以提高工作效率。但是请注意,设置快捷键时,不要和默认的快捷键干涉,也不要去修改默认的快捷键。这样有利于其他同事使用该电脑。 ...