mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 21:51:57 +00:00
Fix tests
This commit is contained in:
parent
adadfdcbce
commit
e2470dd670
@ -43,13 +43,13 @@ CSVRowInputFormat::CSVRowInputFormat(
|
||||
bool with_types_,
|
||||
const FormatSettings & format_settings_)
|
||||
: CSVRowInputFormat(
|
||||
header_, std::make_unique<PeekableReadBuffer>(in_), params_, with_names_, with_types_, format_settings_)
|
||||
header_, std::make_shared<PeekableReadBuffer>(in_), params_, with_names_, with_types_, format_settings_)
|
||||
{
|
||||
}
|
||||
|
||||
CSVRowInputFormat::CSVRowInputFormat(
|
||||
const Block & header_,
|
||||
std::unique_ptr<PeekableReadBuffer> in_,
|
||||
std::shared_ptr<PeekableReadBuffer> in_,
|
||||
const Params & params_,
|
||||
bool with_names_,
|
||||
bool with_types_,
|
||||
@ -72,7 +72,7 @@ CSVRowInputFormat::CSVRowInputFormat(
|
||||
|
||||
CSVRowInputFormat::CSVRowInputFormat(
|
||||
const Block & header_,
|
||||
std::unique_ptr<PeekableReadBuffer> in_,
|
||||
std::shared_ptr<PeekableReadBuffer> in_,
|
||||
const Params & params_,
|
||||
bool with_names_,
|
||||
bool with_types_,
|
||||
|
@ -29,10 +29,10 @@ public:
|
||||
void setReadBuffer(ReadBuffer & in_) override;
|
||||
|
||||
protected:
|
||||
CSVRowInputFormat(const Block & header_, std::unique_ptr<PeekableReadBuffer> in_, const Params & params_,
|
||||
CSVRowInputFormat(const Block & header_, std::shared_ptr<PeekableReadBuffer> in_, const Params & params_,
|
||||
bool with_names_, bool with_types_, const FormatSettings & format_settings_, std::unique_ptr<FormatWithNamesAndTypesReader> format_reader_);
|
||||
|
||||
CSVRowInputFormat(const Block & header_, std::unique_ptr<PeekableReadBuffer> in_buf_, const Params & params_,
|
||||
CSVRowInputFormat(const Block & header_, std::shared_ptr<PeekableReadBuffer> in_buf_, const Params & params_,
|
||||
bool with_names_, bool with_types_, const FormatSettings & format_settings_);
|
||||
|
||||
private:
|
||||
@ -40,7 +40,7 @@ private:
|
||||
void syncAfterError() override;
|
||||
|
||||
protected:
|
||||
std::unique_ptr<PeekableReadBuffer> buf;
|
||||
std::shared_ptr<PeekableReadBuffer> buf;
|
||||
};
|
||||
|
||||
class CSVFormatReader : public FormatWithNamesAndTypesReader
|
||||
|
@ -30,9 +30,9 @@ HiveTextRowInputFormat::HiveTextRowInputFormat(
|
||||
}
|
||||
|
||||
HiveTextRowInputFormat::HiveTextRowInputFormat(
|
||||
const Block & header_, std::unique_ptr<PeekableReadBuffer> buf_, const Params & params_, const FormatSettings & format_settings_)
|
||||
const Block & header_, std::shared_ptr<PeekableReadBuffer> buf_, const Params & params_, const FormatSettings & format_settings_)
|
||||
: CSVRowInputFormat(
|
||||
header_, std::move(buf_), params_, true, false, format_settings_, std::make_unique<HiveTextFormatReader>(*buf_, format_settings_))
|
||||
header_, buf_, params_, true, false, format_settings_, std::make_unique<HiveTextFormatReader>(*buf_, format_settings_))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
|
||||
private:
|
||||
HiveTextRowInputFormat(
|
||||
const Block & header_, std::unique_ptr<PeekableReadBuffer> buf_, const Params & params_, const FormatSettings & format_settings_);
|
||||
const Block & header_, std::shared_ptr<PeekableReadBuffer> buf_, const Params & params_, const FormatSettings & format_settings_);
|
||||
};
|
||||
|
||||
class HiveTextFormatReader final : public CSVFormatReader
|
||||
|
@ -176,6 +176,23 @@ private:
|
||||
}
|
||||
|
||||
ReaderHolder() = default;
|
||||
ReaderHolder(const ReaderHolder & other) = delete;
|
||||
ReaderHolder & operator=(const ReaderHolder & other) = delete;
|
||||
|
||||
ReaderHolder(ReaderHolder && other) noexcept
|
||||
{
|
||||
*this = std::move(other);
|
||||
}
|
||||
|
||||
ReaderHolder & operator=(ReaderHolder && other) noexcept
|
||||
{
|
||||
/// The order of destruction is important.
|
||||
/// reader uses pipeline, pipeline uses read_buf.
|
||||
reader = std::move(other.reader);
|
||||
pipeline = std::move(other.pipeline);
|
||||
read_buf = std::move(other.read_buf);
|
||||
return *this;
|
||||
}
|
||||
|
||||
explicit operator bool() const { return reader != nullptr; }
|
||||
PullingPipelineExecutor * operator->() { return reader.get(); }
|
||||
|
Loading…
Reference in New Issue
Block a user