| 1273 | Result<std::shared_ptr<Array>> BuildArray(const std::vector<ValueType>& values, |
| 1274 | const std::shared_ptr<DataType>& array_type) { |
| 1275 | struct Builder { |
| 1276 | const std::vector<ArrayStatistics::ValueType>& values; |
| 1277 | const std::shared_ptr<DataType>& array_type; |
| 1278 | explicit Builder(const std::vector<ArrayStatistics::ValueType>& values, |
| 1279 | const std::shared_ptr<DataType>& array_type) |
| 1280 | : values(values), array_type(array_type) {} |
| 1281 | |
| 1282 | Result<std::shared_ptr<Array>> operator()(const bool&) { |
| 1283 | auto raw_values = StatisticsValuesToRawValues<bool>(values); |
| 1284 | return BuildArray<BooleanType>(raw_values); |
| 1285 | } |
| 1286 | Result<std::shared_ptr<Array>> operator()(const int64_t&) { |
| 1287 | auto raw_values = StatisticsValuesToRawValues<int64_t>(values); |
| 1288 | return BuildArray<Int64Type>(raw_values); |
| 1289 | } |
| 1290 | Result<std::shared_ptr<Array>> operator()(const uint64_t&) { |
| 1291 | auto raw_values = StatisticsValuesToRawValues<uint64_t>(values); |
| 1292 | return BuildArray<UInt64Type>(raw_values); |
| 1293 | } |
| 1294 | Result<std::shared_ptr<Array>> operator()(const double&) { |
| 1295 | auto raw_values = StatisticsValuesToRawValues<double>(values); |
| 1296 | return BuildArray<DoubleType>(raw_values); |
| 1297 | } |
| 1298 | Result<std::shared_ptr<Array>> operator()(const std::string&) { |
| 1299 | auto raw_values = StatisticsValuesToRawValues<std::string>(values); |
| 1300 | return BuildArray(array_type, raw_values); |
| 1301 | } |
| 1302 | } builder(values, array_type); |
| 1303 | return std::visit(builder, values[0]); |
| 1304 | } |
| 1305 |
no outgoing calls