| 198 | } |
| 199 | |
| 200 | Result<std::shared_ptr<Array>> ScalarVectorToArray(const ScalarVector& scalars) { |
| 201 | if (scalars.empty()) { |
| 202 | return Status::NotImplemented("ScalarVectorToArray with no scalars"); |
| 203 | } |
| 204 | std::unique_ptr<arrow::ArrayBuilder> builder; |
| 205 | RETURN_NOT_OK(MakeBuilder(default_memory_pool(), scalars[0]->type, &builder)); |
| 206 | RETURN_NOT_OK(builder->AppendScalars(scalars)); |
| 207 | std::shared_ptr<Array> out; |
| 208 | RETURN_NOT_OK(builder->Finish(&out)); |
| 209 | return out; |
| 210 | } |
| 211 | |
| 212 | namespace gen { |
| 213 |