Error One:
The alias of the field cannot be used after Hive's where,
Error Two:
You cannot define a function in Hive's groupby, otherwise an error (replaced with a nested select)
Error Three:
When running: $./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:
Because the 11-row Creation folder code did not work, it resulted 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 changed code:
if [!-D $output]then mkdir-p $outputfi
Did you see the difference? There should be a space between $output and]!
。
error Four:date not recognized
When you run the./hive_game_operationstatis6.sh script. An error such as the following:
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!
I can not see the problem from the error message alone. Please look directly at the error code:
Change the previous code:
Date= ' Date +%y%m%d '
After you change 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 ' of the double-cited.
。
If a variable is followed by a string, it can be used directly to the left.
For my first contact with the shell. It's a pain in the neck!
I hope you will not make a similar mistake.
There are a couple of egg-ache problems when writing hive SQL and shell scripts!