Get query results in a different format

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

you can use jackson smile serialization that will be faster thought !

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

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.

Yes, it should match.

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