| 958 | } |
| 959 | |
| 960 | std::shared_ptr<Comparator> DoMakeComparator(Type::type physical_type, |
| 961 | LogicalType::Type::type logical_type, |
| 962 | SortOrder::type sort_order, |
| 963 | int type_length) { |
| 964 | if (SortOrder::SIGNED == sort_order) { |
| 965 | switch (physical_type) { |
| 966 | case Type::BOOLEAN: |
| 967 | return std::make_shared<TypedComparatorImpl<true, BooleanType>>(); |
| 968 | case Type::INT32: |
| 969 | return std::make_shared<TypedComparatorImpl<true, Int32Type>>(); |
| 970 | case Type::INT64: |
| 971 | return std::make_shared<TypedComparatorImpl<true, Int64Type>>(); |
| 972 | case Type::INT96: |
| 973 | return std::make_shared<TypedComparatorImpl<true, Int96Type>>(); |
| 974 | case Type::FLOAT: |
| 975 | return std::make_shared<TypedComparatorImpl<true, FloatType>>(); |
| 976 | case Type::DOUBLE: |
| 977 | return std::make_shared<TypedComparatorImpl<true, DoubleType>>(); |
| 978 | case Type::BYTE_ARRAY: |
| 979 | return std::make_shared<TypedComparatorImpl<true, ByteArrayType>>(); |
| 980 | case Type::FIXED_LEN_BYTE_ARRAY: |
| 981 | if (logical_type == LogicalType::Type::FLOAT16) { |
| 982 | return std::make_shared<TypedComparatorImpl<true, Float16LogicalType>>( |
| 983 | type_length); |
| 984 | } |
| 985 | return std::make_shared<TypedComparatorImpl<true, FLBAType>>(type_length); |
| 986 | default: |
| 987 | ParquetException::NYI("Signed Compare not implemented"); |
| 988 | } |
| 989 | } else if (SortOrder::UNSIGNED == sort_order) { |
| 990 | switch (physical_type) { |
| 991 | case Type::INT32: |
| 992 | return std::make_shared<TypedComparatorImpl<false, Int32Type>>(); |
| 993 | case Type::INT64: |
| 994 | return std::make_shared<TypedComparatorImpl<false, Int64Type>>(); |
| 995 | case Type::INT96: |
| 996 | return std::make_shared<TypedComparatorImpl<false, Int96Type>>(); |
| 997 | case Type::BYTE_ARRAY: |
| 998 | return std::make_shared<TypedComparatorImpl<false, ByteArrayType>>(); |
| 999 | case Type::FIXED_LEN_BYTE_ARRAY: |
| 1000 | return std::make_shared<TypedComparatorImpl<false, FLBAType>>(type_length); |
| 1001 | default: |
| 1002 | ParquetException::NYI("Unsigned Compare not implemented"); |
| 1003 | } |
| 1004 | } else { |
| 1005 | throw ParquetException("UNKNOWN Sort Order"); |
| 1006 | } |
| 1007 | return nullptr; |
| 1008 | } |
| 1009 | |
| 1010 | } // namespace |
| 1011 |
no test coverage detected