| 623 | }; |
| 624 | |
| 625 | Result<TypeHolder> ResolveStructFieldType(KernelContext* ctx, |
| 626 | const std::vector<TypeHolder>& types) { |
| 627 | const auto& field_ref = OptionsWrapper<StructFieldOptions>::Get(ctx).field_ref; |
| 628 | const DataType* type = types.front().type; |
| 629 | |
| 630 | FieldPath field_path; |
| 631 | if (field_ref.IsNested() || field_ref.IsName()) { |
| 632 | ARROW_ASSIGN_OR_RAISE(field_path, field_ref.FindOne(*type)); |
| 633 | } else { |
| 634 | field_path = *field_ref.field_path(); |
| 635 | } |
| 636 | |
| 637 | for (const auto& index : field_path.indices()) { |
| 638 | RETURN_NOT_OK(StructFieldFunctor::CheckIndex(index, *type)); |
| 639 | type = type->field(index)->type().get(); |
| 640 | } |
| 641 | return type; |
| 642 | } |
| 643 | |
| 644 | void AddStructFieldKernels(ScalarFunction* func) { |
| 645 | for (const auto in_type : {Type::STRUCT, Type::DENSE_UNION, Type::SPARSE_UNION}) { |
nothing calls this directly
no test coverage detected