| 913 | } |
| 914 | |
| 915 | Result<std::shared_ptr<Array>> MakeEmptyArray(std::shared_ptr<DataType> type, |
| 916 | MemoryPool* memory_pool) { |
| 917 | if (type->id() == Type::EXTENSION) { |
| 918 | const auto& ext_type = checked_cast<const ExtensionType&>(*type); |
| 919 | ARROW_ASSIGN_OR_RAISE(auto storage, |
| 920 | MakeEmptyArray(ext_type.storage_type(), memory_pool)); |
| 921 | storage->data()->type = std::move(type); |
| 922 | return ext_type.MakeArray(storage->data()); |
| 923 | } |
| 924 | std::unique_ptr<ArrayBuilder> builder; |
| 925 | RETURN_NOT_OK(MakeBuilder(memory_pool, type, &builder)); |
| 926 | RETURN_NOT_OK(builder->Resize(0)); |
| 927 | return builder->Finish(); |
| 928 | } |
| 929 | |
| 930 | namespace internal { |
| 931 |
no test coverage detected