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

Method ReadOptional

cpp/src/parquet/stream_reader.cc:342–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342bool StreamReader::ReadOptional(ByteArray* v) {
343 const auto& node = nodes_[column_index_];
344 auto reader = static_cast<ByteArrayReader*>(column_readers_[column_index_++].get());
345 int16_t def_level;
346 int16_t rep_level;
347 int64_t values_read;
348
349 reader->ReadBatch(kBatchSizeOne, &def_level, &rep_level, v, &values_read);
350
351 if (values_read == 1) {
352 return true;
353 } else if ((values_read == 0) && (def_level == 0)) {
354 return false;
355 }
356 ThrowReadFailedException(node);
357}
358
359void StreamReader::Read(FixedLenByteArray* v) {
360 const auto& node = nodes_[column_index_];

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
ReadBatchMethod · 0.45

Tested by

no test coverage detected