| 554 | } |
| 555 | |
| 556 | static std::shared_ptr<GroupNode> MakeSimpleSchema(const DataType& type, |
| 557 | Repetition::type repetition) { |
| 558 | int32_t byte_width = -1; |
| 559 | |
| 560 | switch (type.id()) { |
| 561 | case ::arrow::Type::DICTIONARY: { |
| 562 | const auto& dict_type = static_cast<const ::arrow::DictionaryType&>(type); |
| 563 | const DataType& values_type = *dict_type.value_type(); |
| 564 | switch (values_type.id()) { |
| 565 | case ::arrow::Type::FIXED_SIZE_BINARY: |
| 566 | byte_width = |
| 567 | static_cast<const ::arrow::FixedSizeBinaryType&>(values_type).byte_width(); |
| 568 | break; |
| 569 | case ::arrow::Type::HALF_FLOAT: |
| 570 | byte_width = sizeof(::arrow::HalfFloatType::c_type); |
| 571 | break; |
| 572 | case ::arrow::Type::DECIMAL128: |
| 573 | case ::arrow::Type::DECIMAL256: { |
| 574 | const auto& decimal_type = static_cast<const DecimalType&>(values_type); |
| 575 | byte_width = DecimalType::DecimalSize(decimal_type.precision()); |
| 576 | } break; |
| 577 | default: |
| 578 | break; |
| 579 | } |
| 580 | } break; |
| 581 | case ::arrow::Type::FIXED_SIZE_BINARY: |
| 582 | byte_width = static_cast<const ::arrow::FixedSizeBinaryType&>(type).byte_width(); |
| 583 | break; |
| 584 | case ::arrow::Type::HALF_FLOAT: |
| 585 | byte_width = sizeof(::arrow::HalfFloatType::c_type); |
| 586 | break; |
| 587 | case ::arrow::Type::DECIMAL128: |
| 588 | case ::arrow::Type::DECIMAL256: { |
| 589 | const auto& decimal_type = static_cast<const DecimalType&>(type); |
| 590 | byte_width = DecimalType::DecimalSize(decimal_type.precision()); |
| 591 | } break; |
| 592 | default: |
| 593 | break; |
| 594 | } |
| 595 | auto pnode = PrimitiveNode::Make("column1", repetition, get_logical_type(type), |
| 596 | get_physical_type(type), byte_width); |
| 597 | NodePtr node_ = |
| 598 | GroupNode::Make("schema", Repetition::REQUIRED, std::vector<NodePtr>({pnode})); |
| 599 | return std::static_pointer_cast<GroupNode>(node_); |
| 600 | } |
| 601 | |
| 602 | void ReadSingleColumnFileStatistics(std::unique_ptr<FileReader> file_reader, |
| 603 | std::shared_ptr<Scalar>* min, |
no test coverage detected