| 102 | |
| 103 | template <typename Visitor> |
| 104 | Status VisitLastRow(Visitor&& visit) const { |
| 105 | using detail::ParsedValueDesc; |
| 106 | |
| 107 | const auto& values_buffer = values_buffers_.back(); |
| 108 | const auto values = reinterpret_cast<const ParsedValueDesc*>(values_buffer->data()); |
| 109 | const auto start_pos = |
| 110 | static_cast<int32_t>(values_buffer->size() / sizeof(ParsedValueDesc)) - |
| 111 | num_cols_ - 1; |
| 112 | const bool last_row_has_missing_fields = |
| 113 | !missing_fields_.empty() && missing_fields_.back().row == num_rows_ - 1; |
| 114 | for (int32_t col_index = 0; col_index < num_cols_; ++col_index) { |
| 115 | auto start = values[start_pos + col_index].offset; |
| 116 | auto stop = values[start_pos + col_index + 1].offset; |
| 117 | auto quoted = values[start_pos + col_index + 1].quoted; |
| 118 | const bool missing = last_row_has_missing_fields && |
| 119 | col_index >= missing_fields_.back().first_missing_column; |
| 120 | ARROW_RETURN_NOT_OK(visit(parsed_ + start, stop - start, quoted, missing)); |
| 121 | } |
| 122 | return Status::OK(); |
| 123 | } |
| 124 | |
| 125 | protected: |
| 126 | Status DecorateWithRowNumber(Status&& status, int64_t first_row, |