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.

Is there a way to get results of hive command instead of getting job id in WebHCat?

Solved Go to solution
Highlighted

Is there a way to get results of hive command instead of getting job id in WebHCat?

Mentor

If I execute the following

curl -s -d execute="select+*+from+sample_08;" \

-d statusdir="outputofthejob" \

'http://localhost:50111/templeton/v1/hive?user.name=root'

I get a job id of the job in JSON format, is there a way to get actual result of the query rather than job id?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Is there a way to get results of hive command instead of getting job id in WebHCat?

Master Collaborator

No, WebHCat does not provide any options to get the query output as part of the response object. Either you use the WebHDFS api to inspect the contents of the output directory or if your concern is the transport mode, you could JDBC connection to the HiveServer2 configured in HTTP mode.

View solution in original post

8 REPLIES 8
Highlighted

Re: Is there a way to get results of hive command instead of getting job id in WebHCat?

@Artem Ervits So you mean, you want output of query i.e. "Select * from emp where dept_id=10"?

Highlighted

Re: Is there a way to get results of hive command instead of getting job id in WebHCat?

@Pardeep I believe, Yes

Highlighted

Re: Is there a way to get results of hive command instead of getting job id in WebHCat?

Mentor

yes, I want to see the results instead of looking in outputofthejob/part-m-0000. I didn't see any options in WebHCat wiki.

Highlighted

Re: Is there a way to get results of hive command instead of getting job id in WebHCat?

@Artem Ervits

The actual result is going under "outputofthejob" on HDFS. I don't see any options to get exact data using that command or any other option. Limit information in the doc.

Highlighted

Re: Is there a way to get results of hive command instead of getting job id in WebHCat?

@Artem Ervits Time to open an enhancement request ;)

Highlighted

Re: Is there a way to get results of hive command instead of getting job id in WebHCat?

Mentor
Highlighted

Re: Is there a way to get results of hive command instead of getting job id in WebHCat?

Master Collaborator

No, WebHCat does not provide any options to get the query output as part of the response object. Either you use the WebHDFS api to inspect the contents of the output directory or if your concern is the transport mode, you could JDBC connection to the HiveServer2 configured in HTTP mode.

View solution in original post

Re: Is there a way to get results of hive command instead of getting job id in WebHCat?

Contributor

Performing a hdfs cat on stdout file inside the outputofthejob directory will give the output from hive.

hdfs dfs -cat <location-of-outputofthejob>/stdout

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