pig script common errors

1、ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: String index out of range: 36

The reason: the end of more spaces

video_read_allnet = LOAD '/user/hdphailiyang/statistics/kyk_close/video_read_allnet/${date}/p*';
-- `awk XXX ` XXX后面不能有空格
video_read_allnet = STREAM video_read_allnet THROUGH `awk -F'[\t|]' '{print $1"\t"$2"\t"$3}'`;
2、ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing.
   Encountered " <PATH> "book=load "" at line 2, column 1.
   Was expecting one of:
       <EOF> 
       "cat" ...
       "clear" ...
       "fs" ...
       "sh" ...
       "cd" ...
       "cp" ...
       "copyFromLocal" ...
       "copyToLocal" ...
       "dump" ...
       "\\d" ...
       "describe" ...
       "\\de" ...
       "aliases" ...
       "explain" ...
       "\\e" ...
       "help" ...
       "history" ...
       "kill" ...
       "ls" ...
       "mv" ...
       "mkdir" ...
       "pwd" ...
       "quit" ...
       "\\q" ...
       "register" ...
       "rm" ...
       "rmf" ...
       "set" ...
       "illustrate" ...
       "\\i" ...
       "run" ...
       "exec" ...
       "scriptDone" ...
       "" ...
       "" ...
       <EOL> ...
       ";" ...

The reason: to leave spaces on both sides of the equal sign

A=LOAD 'XXX'  => A = LOAD 'XXX'
3、ERROR org.apache.pig.Main - ERROR 2997: Encountered IOException. org.apache.pig.tools.parameters.ParseException: Encountered “” at line 1, column 9

My script is the first line

SET default_parallel 500;

The reason:
When using a shell script called, -p parameters available, the parameter is deleted in front of me, but the script does not remove the corresponding -p parameter, so the error.

4、Invalid field projection. Projected field [group_res1::pv] does not exist in schema: group:chararray,group_res1:bag{:tuple(uin:chararray,pv:long)}.
group_res1 = GROUP join_res1 BY (uin, docid);

group_res1 = FOREACH group_res1 GENERATE group.$0 AS uin, COUNT($1) AS pv;

uin_max1 = GROUP group_res1 BY uin;

# 这一行报错
uin_max1 = FOREACH uin_max1 GENERATE FLATTEN(group) AS uin, MAX(group_res1::pv) AS pv;

Where pv is group_res1 in the tuple data structure, not a double-colon, with a point to be acquired, modified as follows:

uin_max1 = FOREACH uin_max1 GENERATE FLATTEN(group) AS uin, MAX(group_res1.pv) AS pv;
Published 114 original articles · won praise 55 · views 80000 +

Guess you like

Origin blog.csdn.net/zuolixiangfisher/article/details/99623240