mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 02:41:59 +00:00
9609bd9dee
Add formats tests, fixes for JSONCompactEachRowWithNamesAndTypes, TSVWithNamesAndTypes. Some CR fixes Add sanitizing for kafka_max_block_size and kafka_poll_max_batch_size
32 lines
822 B
C++
32 lines
822 B
C++
#pragma once
|
|
|
|
#include <Processors/Formats/IRowInputFormat.h>
|
|
#include <Formats/FormatFactory.h>
|
|
#include <IO/PeekableReadBuffer.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ReadBuffer;
|
|
|
|
/// This format parses a sequence of JSON objects separated by newlines, spaces and/or comma.
|
|
/// Each JSON object is parsed as a whole to string.
|
|
/// This format can only parse a table with single field of type String.
|
|
|
|
class JSONAsStringRowInputFormat : public IRowInputFormat
|
|
{
|
|
public:
|
|
JSONAsStringRowInputFormat(const Block & header_, ReadBuffer & in_, Params params_);
|
|
|
|
bool readRow(MutableColumns & columns, RowReadExtension & ext) override;
|
|
String getName() const override { return "JSONAsStringRowInputFormat"; }
|
|
void resetParser() override;
|
|
|
|
private:
|
|
void readJSONObject(IColumn & column);
|
|
|
|
PeekableReadBuffer buf;
|
|
};
|
|
|
|
}
|