[[arrow::export]]
| 59 | |
| 60 | // [[arrow::export]] |
| 61 | std::shared_ptr<arrow::Array> MakeArrayFromScalar( |
| 62 | const std::shared_ptr<arrow::Scalar>& scalar, int n) { |
| 63 | if (scalar->type->id() == arrow::Type::EXTENSION) { |
| 64 | auto extension_scalar = std::dynamic_pointer_cast<arrow::ExtensionScalar>(scalar); |
| 65 | auto type = std::dynamic_pointer_cast<arrow::ExtensionType>(scalar->type); |
| 66 | auto storage_type = type->storage_type(); |
| 67 | auto storage = ValueOrStop( |
| 68 | arrow::MakeArrayFromScalar(*extension_scalar->value, n, gc_memory_pool())); |
| 69 | return type->WrapArray(type, storage); |
| 70 | } else { |
| 71 | return ValueOrStop(arrow::MakeArrayFromScalar(*scalar, n, gc_memory_pool())); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | // [[arrow::export]] |
| 76 | bool Scalar__is_valid(const std::shared_ptr<arrow::Scalar>& s) { return s->is_valid; } |
no test coverage detected