drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Givre <cgi...@gmail.com>
Subject Re: Suggestion needed for REST API JSON response format
Date Tue, 14 Apr 2020 14:57:46 GMT
Hi Navin, 
Can you try the following query and see what happens?

SELECT id, CAST(sales AS INT) AS sales, name ... FROM dfs.`sample*.parquet

Also what version of Drill are you using?
-- C

> On Apr 14, 2020, at 10:55 AM, sreeparna bhabani <bhabani.sreeparna@gmail.com> wrote:
> 
> Hi Team,
> 
> We reach out to you for a specific help. I have given the details below.
> 
> *Situation :*
> We have a Web UI which calls Apache Drill Query using REST API. Please find
> below the sample call where we are querying *Parquet** file*.
> 
> curl -X POST -H "Content-Type: application/json" -d '{"queryType":"SQL",
> "query": "select * from dfs.`sample*.parquet*`", "autoLimit":1}'
> http://localhost:8047/query.json
> 
> *Problem : *
> The response JSON is successfully received (sample below). There are few
> columns which are of type Number in Parquet file, e.g - "sales".
> {
>   "columns" : [ "id", "name", "sales", ......... ],
>   "rows" : [ {
>     "id" : "0001",
>     "sales" : "65",
>     "name" : "XYZ",
>    ................
>   } ]
> }
> 
> But we are getting the Number values in  "" like highlighted above, which
> is creating problem in Web UI.
> 
> *Expectation :*
> We would need the same response with Number values without "", like below.
> {
>   "columns" : [ "id", "name", "sales", ......... ],
>   "rows" : [ {
>     "id" : "0001",
>     "sales" : 65,
>     "name" : "XYZ",
>    ................
>   } ]
> }
> 
> Please suggest us how to resolve the same.
> 
> Thanks in advance for your assistance.
> 
> *Sreeparna Bhabani*


Mime
View raw message