Support Questions

Find answers, ask questions, and share your expertise

%jdbc(hive) prefix not found in Zeppelin

I am going through the following lab:

http://hortonworks.com/hadoop-tutorial/hello-world-an-introduction-to-hadoop-hcatalog-hive-and-pig/#...

and in paragraph 6.2 (execute a hive query) I am trying to run the following code in Zeppelin: %jbdc(hive) SELECT * FROM riskfactor

When I execute this code I run into the error "prefix not found". What am I doing wrong here. This seems pretty straightforward.

Regards,

Robbert

1 ACCEPTED SOLUTION

Make sure you are running the latest HDP 2.5 Sandbox. I've just tested it and I had no "prefix not found" related issues.

View solution in original post

16 REPLIES 16

I've had the same error. Would appreciate help. Thanks in advance.

Guru

Give this a try

%hive

Sorry @Greg Keys but the turorial explicitly states to use %jdbc(hive) for connecting to hive. After SELECT * FROM riskfactor the scipt should show data from the table. After that the tutorial shows that a graph can be made, but I run into this error.

Guru

Give it a try and let me know what happens. I tested it successfully on the latest sandbox. Sometimes updates to the tutorials are delayed -- the latest sandbox itself came out last week

The following worked. Thanks @Greg Keys for the tip. I had to use finalresults instead of riskfactor. The latter didn't give me data. Not sure if I have missed something there. @Robbert Naastepad would be great to know if riskfactor has data for you. Thanks.

%hive

SELECT * FROM finalresults

Hello Cindy, I had to use the finalresults table also. Riskfactor is empty after the Spark tutorial.

Regards,

Robbert.

Thank you for the confirmation @Robbert Naastepad

Hi @Greg Keys,

%hive works as it should, but I was hoping the tutorial would go into using a JDBC driver also. Anyway, thanks for the answer. At least I was able to play around with the graphs in Zeppelin.

Regards, Robbert

Guru

@Robbert

Try this link if you want to explore using the jdbc driver: https://community.hortonworks.com/questions/56113/trying-to-create-phoenix-interpreter-using-jdbc-in...

(Also, if you find my answer provided what you were looking for, let me know by accepting 🙂 )

Expert Contributor

@Robbert Naastepad, could it be the case that the interpreter is not enabled/selected for use in the notebook? See "Configuring a Zeppelin Interpreter" at http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.5.0/bk_zeppelin-component-guide/content/using-in....

Make sure you are running the latest HDP 2.5 Sandbox. I've just tested it and I had no "prefix not found" related issues.

Super Collaborator

There is a typo in the code, please change from %jbdc(hive) to %jdbc(hive). Further, for riskfactor table issue can you please drop the riskfactor table first and then recreate it using CTAS. Run the following commands:

%hive

drop table riskfactor

In another paragraph,

%spark

hiveContext.sql("create table riskfactor as select * from finalresults")

With HDP 2.5 we need to use the jdbc connectors instead of the %sql or hive.

However we had to do the following prior to getting this to work.

in /usr/hdp/current/zeppelin-server/interpreter/jdbc either copy the hive, hadoop and phoenix jars or create soft links for the same

Since all the sample notebooks use the %sql or %hive they would not work.

you will need to use %jdbc(phoenix) or %jdbc(hive) as appropriate.

Once you do this restart the jdbc interpreter

>pwd
/usr/hdp/current/zeppelin-server/interpreter/jdbc 
> ls -l
hive-jdbc.jar -> /usr/hdp/current/hive-client/lib/hive-jdbc-1.2.1000.2.5.0.0-1245-standalone.jar
hadoop-common.jar -> /usr/hdp/current/hadoop-client/hadoop-common-2.7.3.2.5.0.0-1245.jar
phoenix-core-4.7.0.2.5.0.0-1245.jar /usr/hdp/current/phoenix-client/lib/phoenix-core-4.7.0.2.5.0.0-1245.jar

New Contributor

After banging my head against the wall for a while now, Ash's answer was the one I was looking for.

I didn't necessarily get a "%jdbc(hive) prefix not found in Zeppelin". In Zeppelin I got a nondescript error and the logs complaining about java.lang.NoSuchMethodError.

After creating these soft links it worked fine!

really helpful @Ash!

Thanks a lot !

New Contributor

@Greg,

i am trying to execute mysql queries, got error prefix not found. when i verified in mysql note there i observer mysql is there instead of %mysql. But unable to add % before mysql, its not editable. can u please help me how can i edit.

79440-mysql.png