-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL: Support more result formats, add columns header. #6191
Conversation
- Add result formats for line-based JSON and CSV. - Add X-Druid-Sql-Columns header with a list of all columns that the response will contain. - Add more comprehensive documentation on what callers should expect when making Druid SQL queries.
I'm not a huge fan of the 'trailers' here, but from what I can see, our version of Jetty (9.4.10.v20180503) will use chunked encoding, with a well formed final chunk, even if we throw an exception in the middle of a StreamingOutput (despite https://bugs.eclipse.org/bugs/show_bug.cgi?id=424107 which claims this behavior is fixed). I verified this by writing a patch that throws an exception midstream, and confirming in wireshark that the final chunk is there. So that means it's impossible for clients to detect a truncated response without some kind of trailer in the body itself. Does anyone have any better ideas? |
I realized that a single blank line is a better trailer (it still lets you detect truncation, and is easier to ignore). I'll change this. |
* SQL: Support more result formats, add columns header. - Add result formats for line-based JSON and CSV. - Add X-Druid-Sql-Columns header with a list of all columns that the response will contain. - Add more comprehensive documentation on what callers should expect when making Druid SQL queries. * Fix some tests. * Adjust tests. * Adjust trailer, add types header. * Fix trailers.
the response will contain.
when making Druid SQL queries.