hadoop - Apache Pig Error -- Unable to trace -



hadoop - Apache Pig Error -- Unable to trace -

when seek run below pig query, getting error while using sort command. if omit sort transform, query able execute.

grunt> month1 = load 'hdfs://localhost.localdomain:8020/user/cloudera/data/big1/climate_month1.txt' using pigstorage(','); grunt> month2 = load 'hdfs://localhost.localdomain:8020/user/cloudera/data/big1/climate_month2.txt' using pigstorage(','); grunt> month3 = load 'hdfs://localhost.localdomain:8020/user/cloudera/data/big1/climate_month3.txt' using pigstorage(','); grunt> month4 = load 'hdfs://localhost.localdomain:8020/user/cloudera/data/big1/climate_month4.txt' using pigstorage(','); grunt> month5 = load 'hdfs://localhost.localdomain:8020/user/cloudera/data/big1/climate_month5.txt' using pigstorage(','); grunt> months = union month1, month2, month3, month4, month5; grunt> clearweather = filter months skycondition == 'clr'; grunt> shapedweather = foreach clearweather generate date, substring(date,0,4) year, substring(date,4,6) month, substring(date,6,8) day, skycondition, drytemp; grunt> groupedbymonthday = grouping shapedweather (month, day) parallel 10; grunt> aggedresults = foreach groupedbymonthday generate grouping monthday, avg(shapedweather.drytemp) averagetemp, min(shapedweather.drytemp) minimumtemp, max(shapedweather.drytemp) maximumtemp, count(shapedweather.drytemp) counttemp parallel 10; grunt> sortedresult = sort aggedresults $1 desc; 2014-10-31 10:22:44,664 [main] error org.apache.pig.tools.grunt.grunt - error 1200: <line 11, column 0> syntax error, unexpected symbol @ or near 'sortedresult' details @ logfile: /home/cloudera/pig_1414775884282.log

and error file says: /home/cloudera/pig_1414775884282.log can give me solution this.

pig stack trace --------------- error 1200: <line 11, column 0> syntax error, unexpected symbol @ or near 'sortedresult' failed parse: <line 11, column 0> syntax error, unexpected symbol @ or near 'sortedresult' @ org.apache.pig.parser.queryparserdriver.parse(queryparserdriver.java:235) @ org.apache.pig.parser.queryparserdriver.parse(queryparserdriver.java:177) @ org.apache.pig.pigserver$graph.validatequery(pigserver.java:1572) @ org.apache.pig.pigserver$graph.registerquery(pigserver.java:1545) @ org.apache.pig.pigserver.registerquery(pigserver.java:518) @ org.apache.pig.tools.grunt.gruntparser.processpig(gruntparser.java:991) @ org.apache.pig.tools.pigscript.parser.pigscriptparser.parse(pigscriptparser.java:412) @ org.apache.pig.tools.grunt.gruntparser.parsestoponerror(gruntparser.java:194) @ org.apache.pig.tools.grunt.gruntparser.parsestoponerror(gruntparser.java:170) @ org.apache.pig.tools.grunt.grunt.run(grunt.java:69) @ org.apache.pig.main.run(main.java:538) @ org.apache.pig.main.main(main.java:157) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.apache.hadoop.util.runjar.main(runjar.java:208)

no sort command in pig. seek order command

sortedresult = order aggedresults $1 desc;

apache hadoop apache-pig bigdata

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -