| 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) { |
nothing calls this directly
no test coverage detected