Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/arrow
7 changes: 7 additions & 0 deletions src/Processors/Formats/Impl/ArrowBufferedStreams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <IO/copyData.h>
#include <IO/PeekableReadBuffer.h>
#include <arrow/buffer.h>
#include <arrow/util/future.h>
#include <arrow/io/memory.h>
#include <arrow/result.h>
#include <Core/Settings.h>
Expand Down Expand Up @@ -95,6 +96,12 @@ arrow::Result<std::shared_ptr<arrow::Buffer>> RandomAccessFileFromSeekableReadBu
return buffer;
}

arrow::Future<std::shared_ptr<arrow::Buffer>> RandomAccessFileFromSeekableReadBuffer::ReadAsync(const arrow::io::IOContext &, int64_t position, int64_t nbytes)
{
/// Just a stub to to avoid using internal arrow thread pool
return arrow::Future<std::shared_ptr<arrow::Buffer>>::MakeFinished(ReadAt(position, nbytes));
}

arrow::Status RandomAccessFileFromSeekableReadBuffer::Seek(int64_t position)
{
seekable_in.seek(position, SEEK_SET);
Expand Down
5 changes: 5 additions & 0 deletions src/Processors/Formats/Impl/ArrowBufferedStreams.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ class RandomAccessFileFromSeekableReadBuffer : public arrow::io::RandomAccessFil

arrow::Result<std::shared_ptr<arrow::Buffer>> Read(int64_t nbytes) override;

/// Override async reading to avoid using internal arrow thread pool.
/// In our code we don't use async reading, so implementation is sync,
/// we just call ReadAt and return future with ready value.
arrow::Future<std::shared_ptr<arrow::Buffer>> ReadAsync(const arrow::io::IOContext&, int64_t position, int64_t nbytes) override;

arrow::Status Seek(int64_t position) override;

private:
Expand Down