MCPcopy Create free account
hub / github.com/apache/arrow / Make

Method Make

cpp/src/parquet/page_index.cc:964–1008  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

962// Public factory functions
963
964std::unique_ptr<ColumnIndex> ColumnIndex::Make(const ColumnDescriptor& descr,
965 const void* serialized_index,
966 uint32_t index_len,
967 const ReaderProperties& properties,
968 Decryptor* decryptor) {
969 format::ColumnIndex column_index;
970 ThriftDeserializer deserializer(properties);
971 deserializer.DeserializeMessage(reinterpret_cast<const uint8_t*>(serialized_index),
972 &index_len, &column_index, decryptor);
973 if (ARROW_PREDICT_FALSE(LoadEnumSafe(&column_index.boundary_order) ==
974 BoundaryOrder::UNDEFINED)) {
975 // Guard against UB when moving column_index
976 throw ParquetException("Invalid ColumnIndex boundary_order");
977 }
978 switch (descr.physical_type()) {
979 case Type::BOOLEAN:
980 return std::make_unique<TypedColumnIndexImpl<BooleanType>>(descr,
981 std::move(column_index));
982 case Type::INT32:
983 return std::make_unique<TypedColumnIndexImpl<Int32Type>>(descr,
984 std::move(column_index));
985 case Type::INT64:
986 return std::make_unique<TypedColumnIndexImpl<Int64Type>>(descr,
987 std::move(column_index));
988 case Type::INT96:
989 return std::make_unique<TypedColumnIndexImpl<Int96Type>>(descr,
990 std::move(column_index));
991 case Type::FLOAT:
992 return std::make_unique<TypedColumnIndexImpl<FloatType>>(descr,
993 std::move(column_index));
994 case Type::DOUBLE:
995 return std::make_unique<TypedColumnIndexImpl<DoubleType>>(descr,
996 std::move(column_index));
997 case Type::BYTE_ARRAY:
998 return std::make_unique<TypedColumnIndexImpl<ByteArrayType>>(
999 descr, std::move(column_index));
1000 case Type::FIXED_LEN_BYTE_ARRAY:
1001 return std::make_unique<TypedColumnIndexImpl<FLBAType>>(descr,
1002 std::move(column_index));
1003 case Type::UNDEFINED:
1004 return nullptr;
1005 }
1006 ::arrow::Unreachable("Cannot make ColumnIndex of an unknown type");
1007 return nullptr;
1008}
1009
1010std::unique_ptr<OffsetIndex> OffsetIndex::Make(const void* serialized_index,
1011 uint32_t index_len,

Callers

nothing calls this directly

Calls 5

LoadEnumSafeFunction · 0.85
ParquetExceptionFunction · 0.85
UnreachableFunction · 0.85
DeserializeMessageMethod · 0.80
physical_typeMethod · 0.80

Tested by

no test coverage detected