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

Method CountRows

cpp/src/arrow/ipc/reader.cc:1478–1495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1476 }
1477
1478 Result<int64_t> CountRows() override {
1479 int64_t total = 0;
1480 for (int i = 0; i < num_record_batches(); i++) {
1481 ARROW_ASSIGN_OR_RAISE(auto block, GetRecordBatchBlock(i));
1482 ARROW_ASSIGN_OR_RAISE(auto outer_message, ReadMessageFromBlock(block));
1483 auto metadata = outer_message->metadata();
1484 const flatbuf::Message* message = nullptr;
1485 RETURN_NOT_OK(
1486 internal::VerifyMessage(metadata->data(), metadata->size(), &message));
1487 auto batch = message->header_as_RecordBatch();
1488 if (batch == nullptr) {
1489 return Status::IOError(
1490 "Header-type of flatbuffer-encoded Message is not RecordBatch.");
1491 }
1492 total += batch->length();
1493 }
1494 return total;
1495 }
1496
1497 Status Open(const std::shared_ptr<io::RandomAccessFile>& file, int64_t footer_offset,
1498 const IpcReadOptions& options) {

Callers

nothing calls this directly

Calls 7

num_record_batchesFunction · 0.85
VerifyMessageFunction · 0.85
IOErrorFunction · 0.85
metadataMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected