Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Zeppelin hive null point exception HDP 2.4

Solved Go to solution

Zeppelin hive null point exception HDP 2.4

Super Guru

Aggregate functions on hive queries are not working for me on Zeppelin HDP 2.4 cluster. Zeppelin version: zeppelin-server-0.6.0.2.4.0.0-169.jar

I run "show tables" and it works fine. I am able to delete, create and load tables. I am able to select * from table. However if I run a any select count(*), sum(*), etc query it immeditaly fails:

java.lang.NullPointerException
	at org.apache.zeppelin.hive.HiveInterpreter.getConnection(HiveInterpreter.java:184)
	at org.apache.zeppelin.hive.HiveInterpreter.getStatement(HiveInterpreter.java:204)
	at org.apache.zeppelin.hive.HiveInterpreter.executeSql(HiveInterpreter.java:233)
	at org.apache.zeppelin.hive.HiveInterpreter.interpret(HiveInterpreter.java:328)
	at org.apache.zeppelin.interpreter.ClassloaderInterpreter.interpret(ClassloaderInterpreter.java:57)
	at org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:93)
	at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:295)
	at org.apache.zeppelin.scheduler.Job.run(Job.java:171)
	at org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

I ran the same query on beeline and it returned results fine.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Zeppelin hive null point exception HDP 2.4

Super Guru

@Guilherme Braccialli I found the issue. I had to restart the interpertur and rebind the variables in zeppelin.

6 REPLIES 6

Re: Zeppelin hive null point exception HDP 2.4

@Sunile Manjee

I tried aggregate functions with Zeppelin + Sandbox 2.4 and it worked for me.

Are you using %sql interpreter, %pyspark or scala interpreter? Could you please paste full command you are trying to execute?

See my screenshot with %sql example.

2829-screen-shot-2016-03-15-at-234219.png

Re: Zeppelin hive null point exception HDP 2.4

Super Guru

@Guilherme Braccialli That is interesting. I am doing it on a hdp 2.4 cluster (not sandbox). curious now....

Re: Zeppelin hive null point exception HDP 2.4

Super Guru

@Guilherme Braccialli I am using %sql

Re: Zeppelin hive null point exception HDP 2.4

Super Guru

@Guilherme Braccialli I found the issue. I had to restart the interpertur and rebind the variables in zeppelin.

Re: Zeppelin hive null point exception HDP 2.4

Hello sunile

Zeppelin in 2.4 has a bug that has been fixed since then. If you issue any query with a "()" the new parser for prefix will get lost. In your log if your query is "%hive select count(*)" from table you will see the query being sent look like "elect count(*) from table"

This is because the parser looks for a "(prefix_name)" and here mistakes "(*)" for a prefix.

The workaround is use %hive(default) or wait for next release

Highlighted

Re: Zeppelin hive null point exception HDP 2.4

I'm getting same error in HDP 2.4 sandbox, if use %hive on Zeppelin and then aggregate functions are not working...

%hive 

select count(*) from  health_table

java.lang.NullPointerException 

at org.apache.zeppelin.hive.HiveInterpreter.getConnection(HiveInterpreter.java:184)
at org.apache.zeppelin.hive.HiveInterpreter.getStatement(HiveInterpreter.java:204)
at org.apache.zeppelin.hive.HiveInterpreter.executeSql(HiveInterpreter.java:233)
at org.apache.zeppelin.hive.HiveInterpreter.interpret(HiveInterpreter.java:328)
at org.apache.zeppelin.interpreter.ClassloaderInterpreter.interpret(ClassloaderInterpreter.java:57)
at org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:93)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:295)
at org.apache.zeppelin.scheduler.Job.run(Job.java:171)
at org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

This issue resolved when i use %sql.

I know your issue is not to related HDP sandbox 2.4 but may be this comment help someone using %hive on HDP sandbox 2.4.