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

Method Make

cpp/src/parquet/page_index.cc:967–1011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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