eldenmoon commented on code in PR #26749: URL: https://github.com/apache/doris/pull/26749#discussion_r1393627489
########## be/src/olap/rowset/segment_v2/segment.cpp: ########## @@ -318,14 +330,44 @@ Status Segment::_load_index_impl() { }); } +static vectorized::DataTypePtr get_data_type_from_column_meta( + const segment_v2::ColumnMetaPB& column) { + return vectorized::DataTypeFactory::instance().create_data_type(column); +} + +vectorized::DataTypePtr Segment::get_data_type_of(const Field& field, bool ignore_children) const { + // Path has higher priority + if (!field.path().empty()) { + auto node = _sub_column_tree.find_leaf(field.path()); + if (node) { + if (ignore_children || node->children.empty()) { + return node->data.file_column_type; + } + } + // it contains children or column missing in storage, so treat it as variant + return field.is_nullable() + ? vectorized::make_nullable(std::make_shared<vectorized::DataTypeObject>()) + : std::make_shared<vectorized::DataTypeObject>(); + } + // TODO support normal column type + return nullptr; Review Comment: it's an interface for both variant and none variant column, in the future, implement normal column for `light schema change data type` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org