Error One:
The alias of the field cannot be used after Hive's where,
Error Two:
A custom function cannot be used in Hive's groupby, otherwise an error (replaced with a nested select)
Error Three:
When executing: $./hive_game_operationstatis5.sh, the error message is as follows:
./hive_game_operationstatis5.sh:line: [: Missing '] './hive_game_operationstatis5.sh:line:/tmp/statis_ Activitysourcestatis20141014/statis_activitysourcestatis120141014.txt:no such file or directory./hive_game_ Operationstatis5.sh:line 36:/tmp/statis_activitysourcestatis20141014/statis_activitysourcestatis220141014.txt: No such file or Directoryerror 2 (HY000) atline 1:file '/tmp/statis_activitysourcestatis20141014/statis_ Activitysourcestatis120141014.txt ' not Found (errcode:2) ERROR 2 (HY000) atline 1:file '/tmp/statis_ Activitysourcestatis20141014/statis_activitysourcestatis220141014.txt ' not Found (errcode:2)
Error Analysis:
The creation of the 11-row directory code did not work, resulting in a series of errors that could not be found in the file path.
The code when the error occurs:
if [!-D $output]then mkdir-p $outputfi <span style= "font-family:arial, Helvetica, Sans-serif;" > </span>
The Modified code:
if [!-D $output]then mkdir-p $outputfi
See the difference? There should be a space between $output and]!!
error Four:date not recognized
When executing the./hive_game_operationstatis6.sh script, the error is as follows:
Analysis:
In the shell script, I wrote:
output= '/tmp/statis_suspendedwindowstatis ' $datefile _name1= ' statis_suspendedwindowstatis1 ' $date '. txt '
Error display refers to "fuzzy redirection" when called!
Single from the error message can not see why, please look directly at the error code:
To modify the previous code:
Date= ' Date +%y%m%d '
After modifying this bug code:
Date= ' Date +%y%m%d '
Did you see what went wrong? Haha, yes, too pit! The shell is going to use the ' skimming ' on the 1 front of the keyboard, not the ' apostrophe ' in double quotes.
If a variable is a string then directly to the left of the ' off ' can be,
For my first contact with the shell, it was a headache! I hope you will not make a similar mistake.
There are a couple of egg-ache problems when writing hive SQL and shell scripts!