mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #45478 from Avogar/fix-arrow-abort
Fix possible aborts in arrow lib
This commit is contained in:
commit
689fbea759
2
contrib/arrow
vendored
2
contrib/arrow
vendored
@ -1 +1 @@
|
||||
Subproject commit 450a5638704386356f8e520080468fc9bc8bcaf8
|
||||
Subproject commit d03245f801f798c63ee9a7d2b8914a9e5c5cd666
|
@ -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>
|
||||
@ -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);
|
||||
|
@ -62,6 +62,11 @@ public:
|
||||
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user