| 53 | } |
| 54 | |
| 55 | Status RunCompressorBuilder::AppendNulls(int64_t length) { |
| 56 | if (ARROW_PREDICT_FALSE(length == 0)) { |
| 57 | return Status::OK(); |
| 58 | } |
| 59 | if (ARROW_PREDICT_FALSE(current_run_length_ == 0)) { |
| 60 | // Open a new NULL run |
| 61 | DCHECK_EQ(current_value_, NULLPTR); |
| 62 | current_run_length_ = length; |
| 63 | } else if (current_value_ == NULLPTR) { |
| 64 | // Extend the currently open NULL run |
| 65 | current_run_length_ += length; |
| 66 | } else { |
| 67 | // Close then non-NULL run |
| 68 | ARROW_RETURN_NOT_OK(WillCloseRun(current_value_, current_run_length_)); |
| 69 | ARROW_RETURN_NOT_OK(inner_builder_->AppendScalar(*current_value_)); |
| 70 | UpdateDimensions(); |
| 71 | // Open a new NULL run |
| 72 | current_value_.reset(); |
| 73 | current_run_length_ = length; |
| 74 | } |
| 75 | return Status::OK(); |
| 76 | } |
| 77 | |
| 78 | Status RunCompressorBuilder::AppendEmptyValues(int64_t length) { |
| 79 | if (ARROW_PREDICT_FALSE(length == 0)) { |
nothing calls this directly
no test coverage detected