MCPcopy Create free account
hub / github.com/apache/arrow / GetStream

Method GetStream

cpp/src/parquet/properties.cc:30–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace parquet {
29
30std::shared_ptr<ArrowInputStream> ReaderProperties::GetStream(
31 std::shared_ptr<ArrowInputFile> source, int64_t start, int64_t num_bytes) {
32 if (buffered_stream_enabled_) {
33 // ARROW-6180 / PARQUET-1636 Create isolated reader that references segment
34 // of source
35 PARQUET_ASSIGN_OR_THROW(
36 std::shared_ptr<::arrow::io::InputStream> safe_stream,
37 ::arrow::io::RandomAccessFile::GetStream(source, start, num_bytes));
38 PARQUET_ASSIGN_OR_THROW(
39 auto stream, ::arrow::io::BufferedInputStream::Create(buffer_size_, pool_,
40 safe_stream, num_bytes));
41 return stream;
42 } else {
43 PARQUET_ASSIGN_OR_THROW(auto data,
44 source->ReadAt(start, num_bytes, /*allow_short_read=*/false));
45 return std::make_shared<::arrow::io::BufferReader>(data);
46 }
47}
48
49::arrow::internal::Executor* ArrowWriterProperties::executor() const {
50 return executor_ != nullptr ? executor_ : ::arrow::internal::GetCpuThreadPool();

Callers 2

GetColumnPageReaderMethod · 0.45
TESTFunction · 0.45

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.36