| 194 | Status Visit(const DenseUnionType& type) { return MakeUnionArray(type); } |
| 195 | |
| 196 | Status AppendUnionScalar(const DenseUnionType& type, const Scalar& s, |
| 197 | DenseUnionBuilder* builder) { |
| 198 | const auto& scalar = checked_cast<const DenseUnionScalar&>(s); |
| 199 | const auto scalar_field_index = type.child_ids()[scalar.type_code]; |
| 200 | RETURN_NOT_OK(builder->Append(scalar.type_code)); |
| 201 | |
| 202 | for (int field_index = 0; field_index < type.num_fields(); ++field_index) { |
| 203 | auto* child_builder = builder->child_builder(field_index).get(); |
| 204 | if (field_index == scalar_field_index) { |
| 205 | if (scalar.is_valid) { |
| 206 | RETURN_NOT_OK(child_builder->AppendScalar(*scalar.value)); |
| 207 | } else { |
| 208 | RETURN_NOT_OK(child_builder->AppendNull()); |
| 209 | } |
| 210 | } |
| 211 | } |
| 212 | return Status::OK(); |
| 213 | } |
| 214 | |
| 215 | Status AppendUnionScalar(const SparseUnionType& type, const Scalar& s, |
| 216 | SparseUnionBuilder* builder) { |
nothing calls this directly
no test coverage detected