You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Jian Fang <ji...@gmail.com> on 2011/11/04 17:19:45 UTC

Hive installation problem: java.lang.NoSuchFieldError: type

Hi,

I installed hive 0.7.1 to work with Hadoop 0.20.2. I have set up
HADOOP_HOME and HIVE_HOME. I tried to use the Hive shell and got the
following error:

[hadoop@dnjsrcha01 hive]$ bin/hive
Hive history
file=/tmp/hadoop/hive_job_log_hadoop_201111041218_2145572589.txt
hive> show tables;
Exception in thread "main" java.lang.NoSuchFieldError: type
    at
org.apache.hadoop.hive.ql.parse.HiveLexer.mKW_SHOW(HiveLexer.java:1234)
    at
org.apache.hadoop.hive.ql.parse.HiveLexer.mTokens(HiveLexer.java:5942)
    at org.antlr.runtime.Lexer.nextToken(Lexer.java:84)
    at
org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:95)
    at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:238)
    at
org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:521)
    at
org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:436)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:327)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:736)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:164)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:241)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:456)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:156)

What was wrong and how to get it working?

Thanks in advance,

John

Re: Hive installation problem: java.lang.NoSuchFieldError: type

Posted by Jian Fang <ji...@gmail.com>.
Please also upgrade the thrift library. The thrift version Hive uses is
lower than the one in Cassandra 1.0.X and will cause problem if I try to
run

hive --service hiveserver

Thanks,

John

On Thu, Nov 10, 2011 at 2:07 PM, Ashutosh Chauhan <ha...@apache.org>wrote:

> We are planning to upgrade antlr version which should fix this issue.
>  https://issues.apache.org/jira/browse/HIVE-2439
>
> Ashutosh
>
>
> 2011/11/10 Nicolas Lalevée <ni...@hibnet.org>
>
>>
>> Le 4 nov. 2011 à 17:19, Jian Fang a écrit :
>>
>> > Hi,
>> >
>> > I installed hive 0.7.1 to work with Hadoop 0.20.2. I have set up
>> HADOOP_HOME and HIVE_HOME. I tried to use the Hive shell and got the
>> following error:
>> >
>> > [hadoop@dnjsrcha01 hive]$ bin/hive
>> > Hive history file=/tmp/hadoop/hive_job_log_hadoop_201111041218_
>> 2145572589.txt
>> > hive> show tables;
>> > Exception in thread "main" java.lang.NoSuchFieldError: type
>> >     at
>> org.apache.hadoop.hive.ql.parse.HiveLexer.mKW_SHOW(HiveLexer.java:1234)
>> >     at
>> org.apache.hadoop.hive.ql.parse.HiveLexer.mTokens(HiveLexer.java:5942)
>> >     at org.antlr.runtime.Lexer.nextToken(Lexer.java:84)
>> >     at
>> org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:95)
>> >     at org.antlr.runtime.CommonTokenStream.LT
>> (CommonTokenStream.java:238)
>> >     at
>> org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:521)
>> >     at
>> org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:436)
>> >     at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:327)
>> >     at org.apache.hadoop.hive.ql.Driver.run(Driver.java:736)
>> >     at
>> org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:164)
>> >     at
>> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:241)
>> >     at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:456)
>> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >     at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >     at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> >     at java.lang.reflect.Method.invoke(Method.java:597)
>> >     at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
>> >
>> > What was wrong and how to get it working?
>>
>> I don't have the same setup as you, but I got the same error. This is a
>> classpath issue and the version of antlr. Locally I had in my classpath
>> antlr 3.3. Downgrading to 3.0.1 fixed this. 3.0.1 is the version I saw in
>> the build of the 0.7.1 tag of hive (I also saw antlr-2.7.7 is that same
>> compile classpath, but it doesn't work either).
>>
>> Hope it helps,
>> Nicolas
>>
>>
>

Re: Hive installation problem: java.lang.NoSuchFieldError: type

Posted by Ashutosh Chauhan <ha...@apache.org>.
We are planning to upgrade antlr version which should fix this issue.
 https://issues.apache.org/jira/browse/HIVE-2439

Ashutosh

2011/11/10 Nicolas Lalevée <ni...@hibnet.org>

>
> Le 4 nov. 2011 à 17:19, Jian Fang a écrit :
>
> > Hi,
> >
> > I installed hive 0.7.1 to work with Hadoop 0.20.2. I have set up
> HADOOP_HOME and HIVE_HOME. I tried to use the Hive shell and got the
> following error:
> >
> > [hadoop@dnjsrcha01 hive]$ bin/hive
> > Hive history file=/tmp/hadoop/hive_job_log_hadoop_201111041218_
> 2145572589.txt
> > hive> show tables;
> > Exception in thread "main" java.lang.NoSuchFieldError: type
> >     at
> org.apache.hadoop.hive.ql.parse.HiveLexer.mKW_SHOW(HiveLexer.java:1234)
> >     at
> org.apache.hadoop.hive.ql.parse.HiveLexer.mTokens(HiveLexer.java:5942)
> >     at org.antlr.runtime.Lexer.nextToken(Lexer.java:84)
> >     at
> org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:95)
> >     at org.antlr.runtime.CommonTokenStream.LT
> (CommonTokenStream.java:238)
> >     at
> org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:521)
> >     at
> org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:436)
> >     at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:327)
> >     at org.apache.hadoop.hive.ql.Driver.run(Driver.java:736)
> >     at
> org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:164)
> >     at
> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:241)
> >     at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:456)
> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >     at java.lang.reflect.Method.invoke(Method.java:597)
> >     at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
> >
> > What was wrong and how to get it working?
>
> I don't have the same setup as you, but I got the same error. This is a
> classpath issue and the version of antlr. Locally I had in my classpath
> antlr 3.3. Downgrading to 3.0.1 fixed this. 3.0.1 is the version I saw in
> the build of the 0.7.1 tag of hive (I also saw antlr-2.7.7 is that same
> compile classpath, but it doesn't work either).
>
> Hope it helps,
> Nicolas
>
>

Re: Hive installation problem: java.lang.NoSuchFieldError: type

Posted by Jian Fang <ji...@gmail.com>.
Thanks Nicolas. You are right. I looked at my hadoop classpath and found it
included an antlr-3.2.jar jar in the Cassandra library (My hadoop cluster
is integrated with a Cassandra cluster).

Thanks,

John

2011/11/10 Nicolas Lalevée <ni...@hibnet.org>

>
> Le 4 nov. 2011 à 17:19, Jian Fang a écrit :
>
> > Hi,
> >
> > I installed hive 0.7.1 to work with Hadoop 0.20.2. I have set up
> HADOOP_HOME and HIVE_HOME. I tried to use the Hive shell and got the
> following error:
> >
> > [hadoop@dnjsrcha01 hive]$ bin/hive
> > Hive history file=/tmp/hadoop/hive_job_log_hadoop_201111041218_
> 2145572589.txt
> > hive> show tables;
> > Exception in thread "main" java.lang.NoSuchFieldError: type
> >     at
> org.apache.hadoop.hive.ql.parse.HiveLexer.mKW_SHOW(HiveLexer.java:1234)
> >     at
> org.apache.hadoop.hive.ql.parse.HiveLexer.mTokens(HiveLexer.java:5942)
> >     at org.antlr.runtime.Lexer.nextToken(Lexer.java:84)
> >     at
> org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:95)
> >     at org.antlr.runtime.CommonTokenStream.LT
> (CommonTokenStream.java:238)
> >     at
> org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:521)
> >     at
> org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:436)
> >     at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:327)
> >     at org.apache.hadoop.hive.ql.Driver.run(Driver.java:736)
> >     at
> org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:164)
> >     at
> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:241)
> >     at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:456)
> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >     at java.lang.reflect.Method.invoke(Method.java:597)
> >     at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
> >
> > What was wrong and how to get it working?
>
> I don't have the same setup as you, but I got the same error. This is a
> classpath issue and the version of antlr. Locally I had in my classpath
> antlr 3.3. Downgrading to 3.0.1 fixed this. 3.0.1 is the version I saw in
> the build of the 0.7.1 tag of hive (I also saw antlr-2.7.7 is that same
> compile classpath, but it doesn't work either).
>
> Hope it helps,
> Nicolas
>
>

Re: Hive installation problem: java.lang.NoSuchFieldError: type

Posted by Nicolas Lalevée <ni...@hibnet.org>.
Le 4 nov. 2011 à 17:19, Jian Fang a écrit :

> Hi,
> 
> I installed hive 0.7.1 to work with Hadoop 0.20.2. I have set up HADOOP_HOME and HIVE_HOME. I tried to use the Hive shell and got the following error:
> 
> [hadoop@dnjsrcha01 hive]$ bin/hive
> Hive history file=/tmp/hadoop/hive_job_log_hadoop_201111041218_2145572589.txt
> hive> show tables;
> Exception in thread "main" java.lang.NoSuchFieldError: type
>     at org.apache.hadoop.hive.ql.parse.HiveLexer.mKW_SHOW(HiveLexer.java:1234)
>     at org.apache.hadoop.hive.ql.parse.HiveLexer.mTokens(HiveLexer.java:5942)
>     at org.antlr.runtime.Lexer.nextToken(Lexer.java:84)
>     at org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:95)
>     at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:238)
>     at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:521)
>     at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:436)
>     at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:327)
>     at org.apache.hadoop.hive.ql.Driver.run(Driver.java:736)
>     at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:164)
>     at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:241)
>     at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:456)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
> 
> What was wrong and how to get it working?

I don't have the same setup as you, but I got the same error. This is a classpath issue and the version of antlr. Locally I had in my classpath antlr 3.3. Downgrading to 3.0.1 fixed this. 3.0.1 is the version I saw in the build of the 0.7.1 tag of hive (I also saw antlr-2.7.7 is that same compile classpath, but it doesn't work either).

Hope it helps,
Nicolas