[refactor][improvement](type_info) use template and single instance to refactor get type info logic (#8680)

1. use const pointer instead of shared_ptr
2. Restrict array types to support only primitive types and nest up to 9 levels.
This commit is contained in:
caiconghui
2022-04-03 10:10:36 +08:00
committed by GitHub
parent 6b0a642390
commit 4076c5466b
36 changed files with 281 additions and 274 deletions

View File

@ -43,7 +43,7 @@ ColumnPB create_column_pb(const std::string& type, const Ts&... sub_column_types
return column;
}
std::shared_ptr<const TypeInfo> get_type_info(const ColumnPB& column_pb) {
const TypeInfo* get_type_info(const ColumnPB& column_pb) {
TabletColumn tablet_column;
tablet_column.init_from_pb(column_pb);
return get_type_info(&tablet_column);