| 1317 | Result<std::shared_ptr<Array>> BuildArray(const std::vector<ValueType>& values, |
| 1318 | const std::shared_ptr<DataType>& array_type) { |
| 1319 | struct Builder { |
| 1320 | const std::vector<ArrayStatistics::ValueType>& values; |
| 1321 | const std::shared_ptr<DataType>& array_type; |
| 1322 | explicit Builder(const std::vector<ArrayStatistics::ValueType>& values, |
| 1323 | const std::shared_ptr<DataType>& array_type) |
| 1324 | : values(values), array_type(array_type) {} |
| 1325 | |
| 1326 | Result<std::shared_ptr<Array>> operator()(const bool&) { |
| 1327 | auto raw_values = StatisticsValuesToRawValues<bool>(values); |
| 1328 | return BuildArray<BooleanType>(raw_values); |
| 1329 | } |
| 1330 | Result<std::shared_ptr<Array>> operator()(const int64_t&) { |
| 1331 | auto raw_values = StatisticsValuesToRawValues<int64_t>(values); |
| 1332 | return BuildArray<Int64Type>(raw_values); |
| 1333 | } |
| 1334 | Result<std::shared_ptr<Array>> operator()(const uint64_t&) { |
| 1335 | auto raw_values = StatisticsValuesToRawValues<uint64_t>(values); |
| 1336 | return BuildArray<UInt64Type>(raw_values); |
| 1337 | } |
| 1338 | Result<std::shared_ptr<Array>> operator()(const double&) { |
| 1339 | auto raw_values = StatisticsValuesToRawValues<double>(values); |
| 1340 | return BuildArray<DoubleType>(raw_values); |
| 1341 | } |
| 1342 | Result<std::shared_ptr<Array>> operator()(const std::string&) { |
| 1343 | auto raw_values = StatisticsValuesToRawValues<std::string>(values); |
| 1344 | return BuildArray(array_type, raw_values); |
| 1345 | } |
| 1346 | } builder(values, array_type); |
| 1347 | return std::visit(builder, values[0]); |
| 1348 | } |
| 1349 |
no outgoing calls