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