Get query results in a different format

415 views
Skip to first unread message

Alan Yiu

unread,
Oct 5, 2016, 1:17:12 PM10/5/16
to Druid User
Hi all,

I was wondering if there's a setting to return query results in a format other than JSON, such as CSV. I find that for large queries, the resulting JSON file can be quite large and take a long time to decode.

Thanks,

Alan

Slim Bouguerra

unread,
Oct 5, 2016, 2:21:15 PM10/5/16
to druid...@googlegroups.com
you can use jackson smile serialization  that will be faster thought !
-- 

B-Slim
_______/\/\/\_______/\/\/\_______/\/\/\_______/\/\/\_______/\/\/\_______

--
You received this message because you are subscribed to the Google Groups "Druid User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to druid-user+...@googlegroups.com.
To post to this group, send email to druid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/druid-user/25f86084-b579-4720-9688-7e384848887d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nishant Bangarwa

unread,
Oct 5, 2016, 2:21:54 PM10/5/16
to Druid User
there is no such setting for CSV format. However, druid can send results back in smile (http://wiki.fasterxml.com/SmileFormatSpec) format which is more efficient. 
To get results in smile format, you will need to content type as encode your json query using smile format and set content type to application/x-jackson-smile in your query header

--

vishnu rao

unread,
Mar 8, 2017, 10:05:59 PM3/8/17
to Druid User
hi
when i run the query 
curl -X 'POST' -H 'Content-Type:application/x-jackson-smile'  ......"

the query errors out. should the POST body be encoded to x-jackson-smie  for the response to be x-jackson-smile output.

Gian Merlino

unread,
Mar 8, 2017, 10:35:11 PM3/8/17
to druid...@googlegroups.com
Yes, it should match.

Gian

To unsubscribe from this group and stop receiving emails from it, send an email to druid-user+unsubscribe@googlegroups.com.

To post to this group, send email to druid...@googlegroups.com.

vishnu rao

unread,
Mar 8, 2017, 11:23:32 PM3/8/17
to Druid User
thanks Gian

do you have some sample code or curl example... for the same. i have been struggling on this. could not find a test case in the codebase.

also i noticed that words timestamp, version keep showing up in the output json which bloats my response body. hence i was looking at smile.

any way to remove the meta data from the output
Yes, it should match.

Gian

Reply all
Reply to author
Forward
0 new messages