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

Method CountRows

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

Source from the content-addressed store, hash-verified

1461 }
1462
1463 Result<int64_t> CountRows() override {
1464 int64_t total = 0;
1465 for (int i = 0; i < num_record_batches(); i++) {
1466 ARROW_ASSIGN_OR_RAISE(auto block, GetRecordBatchBlock(i));
1467 ARROW_ASSIGN_OR_RAISE(auto outer_message, ReadMessageFromBlock(block));
1468 auto metadata = outer_message->metadata();
1469 const flatbuf::Message* message = nullptr;
1470 RETURN_NOT_OK(
1471 internal::VerifyMessage(metadata->data(), metadata->size(), &message));
1472 auto batch = message->header_as_RecordBatch();
1473 if (batch == nullptr) {
1474 return Status::IOError(
1475 "Header-type of flatbuffer-encoded Message is not RecordBatch.");
1476 }
1477 total += batch->length();
1478 }
1479 return total;
1480 }
1481
1482 Status Open(const std::shared_ptr<io::RandomAccessFile>& file, int64_t footer_offset,
1483 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