Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Zeppelin hive null point exception HDP 2.4

avatar
Master 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

avatar
Master Guru

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

View solution in original post

6 REPLIES 6

avatar
@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

avatar
Master Guru

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

avatar
Master Guru

@Guilherme Braccialli I am using %sql

avatar
Master Guru

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

avatar

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

avatar

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.