Merge pull request #23761 from kssenii/hdfs-fixes

Fix hdfs read with Values format
This commit is contained in:
Kseniia Sumarokova 2021-04-30 11:41:23 +03:00 committed by GitHub
commit fa5cea7a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,11 +122,10 @@ public:
current_path = uri + path;
auto compression = chooseCompressionMethod(path, compression_method);
auto read_buf = wrapReadBufferWithCompressionMethod(std::make_unique<ReadBufferFromHDFS>(uri, path, getContext()->getGlobalContext()->getConfigRef()), compression);
read_buf = wrapReadBufferWithCompressionMethod(std::make_unique<ReadBufferFromHDFS>(uri, path, getContext()->getGlobalContext()->getConfigRef()), compression);
auto input_format = FormatFactory::instance().getInput(format, *read_buf, sample_block, getContext(), max_block_size);
auto input_stream = std::make_shared<InputStreamFromInputFormat>(input_format);
reader = std::make_shared<OwningBlockInputStream<ReadBuffer>>(input_stream, std::move(read_buf));
reader = std::make_shared<InputStreamFromInputFormat>(input_format);
reader->readPrefix();
}
@ -156,10 +155,12 @@ public:
reader->readSuffix();
reader.reset();
read_buf.reset();
}
}
private:
std::unique_ptr<ReadBuffer> read_buf;
BlockInputStreamPtr reader;
SourcesInfoPtr source_info;
String uri;