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.

Any hive API return results?

Any hive API return results?

Super Guru

I want to run a query against a hive api which returns results. right now webhcat return whether job was success or not and stores results on hdfs or local disk. Any API which return query results back to client?

6 REPLIES 6

Re: Any hive API return results?

@Sunile Manjee

you can use thrift api or bare bone java/python-jdbc client (which again use thrift) to return you query result.

Re: Any hive API return results?

Super Guru

@Rajkumar Singh do you example of using thrift api?

Re: Any hive API return results?

Re: Any hive API return results?

@Sunile Manjee

WebHCat, as you probably know, is a web interface that can be used for Hive commands as a REST API (not GUI). With WebHCat, applications can make HTTP requests to access the Hive metastore (HCatalog DDL) or to create and queue Hive queries and commands, Pig jobs, and MapReduce or YARN jobs (either standard or streaming). WebHCat was formerly named Templeton. See these documents for more information:

Re: Any hive API return results?

Super Guru

@dkozlowski If I understand you correctly it queue up hive queries. Nothing to actually return results back to client using webhcat

Re: Any hive API return results?

@Sunile Manjee

The WebHCat link provide you with the sample of curl command to get the result. That is to work with NON-Kerberized env.

If you are Kerberized, the way to get this working is:

$ curl -u s:s --negotiate -d execute="select+*+from+table;" -d statusDir="/tmp/hive" 'http://hostname:50111/templeton/v1/hive'

Don't have an account?
Coming from Hortonworks? Activate your account here