0

I am unable to run any queries from the hive> shell. For example, even something simple such as

hive> select * from date;

produces the same error after parsing is complete:

select * from date Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.hive.ql.parse.ASTNode.setUnknownTokenBoundaries()V at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:214) at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166) at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:389) at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:303) at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1067) at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1129) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1004) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:994) at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:247) at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:199) at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:410) at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:783) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:677) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:616) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136)


Here are the logs:

15/09/02 08:55:12 [main]: INFO hive.metastore: Connected to metastore. 15/09/02 08:55:12 [main]: INFO session.SessionState: Created local directory: /home/ETRI/hive/tmpdir/ETRI/f128f3e2-998f-4463-aa1b-8649db186945_resources 15/09/02 08:55:12 [main]: INFO session.SessionState: Created HDFS directory: /tmp/hive/ETRI/f128f3e2-998f-4463-aa1b-8649db186945 15/09/02 08:55:12 [main]: INFO session.SessionState: Created local directory: /home/ETRI/hive/tmpdir/ETRI/f128f3e2-998f-4463-aa1b-8649db186945 15/09/02 08:55:13 [main]: INFO session.SessionState: Created HDFS directory: /tmp/hive/ETRI/f128f3e2-998f-4463-aa1b-8649db186945/_tmp_space.db 15/09/02 08:55:13 [main]: INFO session.SessionState: No Tez session required at this point. hive.execution.engine=mr. 15/09/02 08:55:13 [main]: INFO log.PerfLogger: 15/09/02 08:55:13 [main]: INFO log.PerfLogger: 15/09/02 08:55:13 [main]: INFO ql.Driver: Concurrency mode is disabled, not creating a lock manager 15/09/02 08:55:13 [main]: INFO log.PerfLogger: 15/09/02 08:55:13 [main]: INFO log.PerfLogger: 15/09/02 08:55:13 [main]: INFO parse.ParseDriver: Parsing command: show tables 15/09/02 08:55:13 [main]: INFO parse.ParseDriver: Parse Completed 15/09/02 08:55:13 [main]: INFO log.PerfLogger:


I have managed the configurations as per the below link.

cloudera Mysql hive config


I am wondering how to handle this setUnknownTokenBoundaries()V method?

I didn't change any methods in ql.parse, as these are internal.

Many thanks.

o-90
  • 17,045
  • 10
  • 39
  • 63
Muthahar
  • 3
  • 2

2 Answers2

0

This is not the issue with Hive or mysql connector.

java.lang.NoSuchMethodError occurs when compiling against one version of a library but running against a different version. Try updating the Java version and set the environmental variables on Hadoop and try running Hive.

safian syed
  • 147
  • 1
  • 6
  • Thanks a lot! yes. I was using java 1.7 and hive 0.14, may be compiler is unable to pick the code I had in hive 0.14. So updated the java 1.8 and used hive again.. and here we go it worked.!!! – Muthahar Sep 03 '15 at 07:36
  • Also I believe this doesnt mean that hive 0.14 runs only in java 1.8. It can also run in java 1.7. May be its because the hive I am using was already used for java 1.8 in other system. Anyway, Issue solved now. Many thanks! – Muthahar Sep 03 '15 at 07:38
0

I think the problem stated can also be a more general issue with Hive and its dependency on ANTLR. In my case, the issue occurs not because of some environment variable but because of ANTLR being included on the classpath of an application that's using Spark including Hive and its dependencies.

ASTNode (part of Hive) is extending CommonTree (part of ANTLR). It inherits the method setUnknownTokenBoundaries which is present in newer versions of ANTLR like 3.5.x but not there in 3.1.x. Sorting out the ANTLR dependencies solved the problem.

Dennis Hunziker
  • 1,293
  • 10
  • 19