Support Questions

Find answers, ask questions, and share your expertise

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

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

avatar

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

avatar

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

avatar
Master Mentor

@Pardeep I believe, Yes

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

avatar
Master Mentor

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

avatar
Master Mentor

@Artem Ervits Time to open an enhancement request 😉

avatar
Master Mentor

avatar

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.

avatar
Rising Star

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

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