Created 02-10-2016 09:19 AM
Unable to query hive tables... was able to retrive the schema of tables, couldn't get the data of the table?
Created 02-10-2016 09:22 AM
See this https://cwiki.apache.org/confluence/display/Hive/HiveWebInterface
What command are you running?
Created 02-10-2016 09:27 AM
@Neeraj Sabharwal We have configured webhcat and is working fine to retrieve the schema http://<IP Address>:50111/templeton/v1/version/hive?user.name=hive result : {"module":"hive","version":"1.2.1.2.3.4.0-3485"} but while running a query to retrieve the data of a hive table , its throwing {
error: null;
}
Created 02-10-2016 09:30 AM
@Krishna Srinivas Can you try this? https://cwiki.apache.org/confluence/display/Hive/WebHCat+Reference+Hive#WebHCatReferenceHive-CurlCom...
and please take a look on this link ...It has lot of information on query
https://cwiki.apache.org/confluence/display/Hive/WebHCat+Reference
Created on 02-10-2016 10:09 AM - edited 08-19-2019 01:57 AM
@Krishna Srinivas Please see this...it's in my vm
Job is still running.
[hive@sandbox ~]$ curl -s -d execute="select+*+from+nstest;” \
> -d statusdir=“nstest.output" \
> 'http://localhost:50111/templeton/v1/hive?user.name=hive'
{"id":"job_1454999065989_0008"}[hive@sandbox ~]$
Created 02-10-2016 01:55 PM
@Krishna Srinivas See this article "Published it based on your question"
https://community.hortonworks.com/articles/15992/hivewebinterface-example.html
Created 02-11-2016 04:51 AM
@Neeraj Sabharwal Thanq for the detailed description and yes the jobs are getting initiated the same way, but am afraid couldn't get it from the google rest api client. How can we execute a query from rest api client, whenever am initiating its throwing
error:null
Created 02-11-2016 10:54 AM
@Krishna Srinivas Do you have connectivity to cluster from google rest api? If connectivity is there then you are all set and if not then its bigger problem.
Created 02-11-2016 12:49 PM
@Neeraj Sabharwal hiveexecutequery.png Please find the document, I am able to do the query but can't see the results from the API. My interest is an application using this api to pull the data
Created 02-11-2016 03:03 PM
@Krishna Srinivas Your job got submitted and now , you need to access output from HDFS. Not possible to display data on screen yet...WIP
Created 06-17-2016 05:34 PM
Hello guys,
This is exaclty what I need, query a Hive Table and show results on screen, is it already implemented?
Thank you
Created 02-10-2016 09:27 AM
@Krishna Srinivas try webhcat
curl -s -d execute="select+*+from+sample_08;" \
-d statusdir="output" \
'http://localhost:50111/templeton/v1/hive?user.name=root'
# if you ls on the directory, it will have two files, stderr and stdout
hdfs dfs -ls output
# if the job succeeded, you can cat the stdout file and view the results
hdfs dfs -cat output/stdout
Created 02-10-2016 09:52 AM
@Neeraj Sabharwal @Artem Ervits Hi , Have tried the same curl -s -d execute="select+*+from+table1;" -d statusdir="status" 'http://<IP add>:50111/templeton/v1/hive?user.name=hive' {"id":"job_1455079614548_0015"} Its showing as ID of job but the status directory is not getting creating in hdfs.
hdfs dfs -ls status ls: `status': No such file or directory
Created 02-10-2016 10:04 AM
Provide full path to sttus dir. "/user/username/status" @Krishna Srinivas
Created 02-10-2016 09:54 AM
@Neeraj Sabharwal @Artem Ervits We have been referring to the URL
https://cwiki.apache.org/confluence/display/Hive/WebHCat+Reference but unfortunately its not too clear for executing queries using webhcat
Created 10-26-2018 04:53 AM
I am also facing same problem, it returns job_id but on cluster these files are not created.
anyone able to resolve this ?
Created 07-19-2019 09:52 PM
Hello guys,
2019 and i still have the same problem with hive api rest . I can successfully run the request :
hduser@master:~$ curl -s -d execute="select+*+from+mytable;" -d statusdir="/home/output" 'http://localhost:50111/templeton/v1/hive?user.name=HIVEU'
and when i want to display the job results :
hduser@master:~$ hdfs dfs -ls output
hduser@master:~$ ls: `output': No such file or directory
Can anyone please give some hepl !