You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Amandeep Singh <am...@gmail.com> on 2015/10/13 11:56:58 UTC
Re::Apache Drill
Hi,
I am using apache drill and I am unable to hit the url :
http://localhost:8047/query.json
(as drill is installed on my localhost).
I want to use the REST service for method query.json to get response in
json form for my sql query.
Please suggest.
Regards,
Amandeep Singh
Re: :Apache Drill
Posted by Hafiz Mujadid <ha...@gmail.com>.
how are u hitting the web service using java code ?
On Tue, Oct 13, 2015 at 2:58 PM, Amandeep Singh <am...@gmail.com>
wrote:
> It is showing the following error:
>
>
> {
> "errorMessage" : "HTTP 405 Method Not Allowed"
> }
>
>
>
> On Tue, Oct 13, 2015 at 3:26 PM, Amandeep Singh <am...@gmail.com>
> wrote:
>
> > Hi,
> >
> > I am using apache drill and I am unable to hit the url :
> > http://localhost:8047/query.json
> > (as drill is installed on my localhost).
> > I want to use the REST service for method query.json to get response in
> > json form for my sql query.
> > Please suggest.
> >
> > Regards,
> > Amandeep Singh
> >
>
--
Regards: HAFIZ MUJADID
Re: :Apache Drill
Posted by Amandeep Singh <am...@gmail.com>.
It is showing the following error:
{
"errorMessage" : "HTTP 405 Method Not Allowed"
}
On Tue, Oct 13, 2015 at 3:26 PM, Amandeep Singh <am...@gmail.com>
wrote:
> Hi,
>
> I am using apache drill and I am unable to hit the url :
> http://localhost:8047/query.json
> (as drill is installed on my localhost).
> I want to use the REST service for method query.json to get response in
> json form for my sql query.
> Please suggest.
>
> Regards,
> Amandeep Singh
>
Re: :Apache Drill
Posted by Carol McDonald <cm...@maprtech.com>.
Here is an example
# curl \
--header "Content-type: application/json" \
--request POST \
--data '{
"queryType" : "SQL",
"query" : "select * from dfs.mydata.orderprodview limit 1"
}' \
http://192.168.110.133:8047/query.json
[ {
"order_total" : 13,
"category" : "Binders and Binder Accessories",
"prod_id" : 909,
"name" : "Wilson Jones Ledger-SizePiano-Hinge Binder2Blue",
"state" : "ca",
"month" : "June",
"order_id" : 67212,
"cust_id" : 10001
}]
Drill provides a Simple REST Interface which you can read more about on the
Drill wiki
https://cwiki.apache.org/confluence/display/DRILL/Apache+Drill+Wiki. Here
is the REST API to submit a query and receive results. You can use HTTP
Post to the Drill URL <drill_node_ip_address>:8047/query.json with a JSON
Request body in the query as shown. You will receive the response as a list
of JSON objects :
POST <drill_node_ip_address>:8047/query.json
Request body:
{
"queryType" : "SQL",
"query" : "select * from dfs.mydata.orderprodview limit 5”
}
Response body (list of JSON objects):
[
{
"order_total" : 13,
"category" : "Binders and Binder Accessories",
"prod_id" : 909,
"name" : "Wilson Jones Ledger-SizePiano-Hinge Binder2Blue",
"state" : "ca", }, …
]
On Wed, Oct 14, 2015 at 3:53 AM, Tugdual Grall <tu...@gmail.com> wrote:
> Hello,
>
> You can also look at this blog post:
>
> https://www.mapr.com/blog/how-use-sql-hadoop-drill-rest-json-nosql-and-hbase-simple-rest-client
>
> Regards
> Tug
> @tgrall
>
> On Wed, Oct 14, 2015 at 6:27 AM, Tomer Shiran <ts...@dremio.com> wrote:
> > Here are a few slides that show how to use the REST API:
> > http://www.slideshare.net/dremio/drill-rest-api
> >
> > Note:
> >
> > - The method should be: POST
> > - Add an HTTP header: "Content-Type: application/json"
> > - Format the payload in JSON
> >
> >
> >
> >
> > On Tue, Oct 13, 2015 at 9:16 PM, Amandeep Singh <amandeeps2091@gmail.com
> >
> > wrote:
> >
> >> Right now I am just trying to hit the url, its not working.
> >> Also through mozilla rest client its not working.
> >>
> >> On Tue, Oct 13, 2015 at 3:26 PM, Amandeep Singh <
> amandeeps2091@gmail.com>
> >> wrote:
> >>
> >> > Hi,
> >> >
> >> > I am using apache drill and I am unable to hit the url :
> >> > http://localhost:8047/query.json
> >> > (as drill is installed on my localhost).
> >> > I want to use the REST service for method query.json to get response
> in
> >> > json form for my sql query.
> >> > Please suggest.
> >> >
> >> > Regards,
> >> > Amandeep Singh
> >> >
> >>
>
Re: :Apache Drill
Posted by Tugdual Grall <tu...@gmail.com>.
Hello,
You can also look at this blog post:
https://www.mapr.com/blog/how-use-sql-hadoop-drill-rest-json-nosql-and-hbase-simple-rest-client
Regards
Tug
@tgrall
On Wed, Oct 14, 2015 at 6:27 AM, Tomer Shiran <ts...@dremio.com> wrote:
> Here are a few slides that show how to use the REST API:
> http://www.slideshare.net/dremio/drill-rest-api
>
> Note:
>
> - The method should be: POST
> - Add an HTTP header: "Content-Type: application/json"
> - Format the payload in JSON
>
>
>
>
> On Tue, Oct 13, 2015 at 9:16 PM, Amandeep Singh <am...@gmail.com>
> wrote:
>
>> Right now I am just trying to hit the url, its not working.
>> Also through mozilla rest client its not working.
>>
>> On Tue, Oct 13, 2015 at 3:26 PM, Amandeep Singh <am...@gmail.com>
>> wrote:
>>
>> > Hi,
>> >
>> > I am using apache drill and I am unable to hit the url :
>> > http://localhost:8047/query.json
>> > (as drill is installed on my localhost).
>> > I want to use the REST service for method query.json to get response in
>> > json form for my sql query.
>> > Please suggest.
>> >
>> > Regards,
>> > Amandeep Singh
>> >
>>
Re: :Apache Drill
Posted by Tomer Shiran <ts...@dremio.com>.
Here are a few slides that show how to use the REST API:
http://www.slideshare.net/dremio/drill-rest-api
Note:
- The method should be: POST
- Add an HTTP header: "Content-Type: application/json"
- Format the payload in JSON
On Tue, Oct 13, 2015 at 9:16 PM, Amandeep Singh <am...@gmail.com>
wrote:
> Right now I am just trying to hit the url, its not working.
> Also through mozilla rest client its not working.
>
> On Tue, Oct 13, 2015 at 3:26 PM, Amandeep Singh <am...@gmail.com>
> wrote:
>
> > Hi,
> >
> > I am using apache drill and I am unable to hit the url :
> > http://localhost:8047/query.json
> > (as drill is installed on my localhost).
> > I want to use the REST service for method query.json to get response in
> > json form for my sql query.
> > Please suggest.
> >
> > Regards,
> > Amandeep Singh
> >
>
Re: :Apache Drill
Posted by Amandeep Singh <am...@gmail.com>.
Right now I am just trying to hit the url, its not working.
Also through mozilla rest client its not working.
On Tue, Oct 13, 2015 at 3:26 PM, Amandeep Singh <am...@gmail.com>
wrote:
> Hi,
>
> I am using apache drill and I am unable to hit the url :
> http://localhost:8047/query.json
> (as drill is installed on my localhost).
> I want to use the REST service for method query.json to get response in
> json form for my sql query.
> Please suggest.
>
> Regards,
> Amandeep Singh
>