0
votes

I have a hadoop running on my localhost. I tried to set up hive and install hive on my localhost. When i gave hive on terminal, following error is coming

/ ade:[ ashsshar_bda_latest_2 ] [ashsshar@slc01nwj tmp2]$ hive

/usr/lib/hive/bin/hive: line 179: conditional binary operator expected

/usr/lib/hive/bin/hive: line 179: syntax error near unexpected token `=~'

/usr/lib/hive/bin/hive: line 179: `if [[ "$HADOOP_VERSION" =~ $hadoop_version_re ]]; then'

To know the hive version i gave hive-version and got following.

ade:[ ashsshar_bda_latest_2 ] [ashsshar@slc01nwj hive]$ hive -version

/usr/lib/hive/bin/hive: line 179: conditional binary operator expected

/usr/lib/hive/bin/hive: line 179: syntax error near unexpected token

=~' /usr/lib/hive/bin/hive: line 179: if [[ "$HADOOP_VERSION" =~

$hadoop_version_re ]]; then'

My hadoop is working fine and show appropriate directorires hadoop fs -ls / Found 2 items

drwxrwxrwt - hdfs supergroup 0 2013-04-05 11:57 /tmp

drwxrwxr-x - hdfs hadoop 0 2013-04-04 10:49 /user

6

6 Answers

0
votes

Seems like you copied the hive code from Windows to Unix or vice versa and things have got screwed.

Can you please download fresh code from Hive tar and then unzip it within same system where you are trying to install.

This should work.

0
votes

I had the same problem with bash version 2.05.8. I found that using a newer version of bash (3.2.25) fixed the problem.

0
votes

Go within bin folder of hive folder which resides in hadoop folder

cd /usr/lib/hive/bin   hive

Hope it will work...

0
votes

Try this keep hive on home directory.

Don't do bashrc stuff for hive just cd to hive folder and use command bash/hive.

0
votes

make sure you have hive/warehouse directory in /user/hive

-1
votes

I solved using this:

export HIVE_HOME=<where did you installed hive> [1] 
export PATH=$HIVE_HOME/bin:$PATH

[1] for example: /opt/apache-hive-2.1.0-bin