Merge pull request #32112 from FrankChen021/content-type

Returns Content-Type as application/json for JSONEachRow if output_format_json_array_of_rows is enabled
This commit is contained in:
Maksim Kita 2021-12-03 18:59:54 +03:00 committed by GitHub
commit 0372403ebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,13 @@ public:
String getName() const override { return "JSONEachRowRowOutputFormat"; }
public:
/// Content-Type to set when sending HTTP response.
String getContentType() const override
{
return settings.json.array_of_rows ? "application/json; charset=UTF-8" : IRowOutputFormat::getContentType();
}
protected:
void writeField(const IColumn & column, const ISerialization & serialization, size_t row_num) override;
void writeFieldDelimiter() override;