Skip to content

Commit

Permalink
[Fix](Variant) sparse columns should not be added in init segment ite…
Browse files Browse the repository at this point in the history
…rator (apache#40295)
  • Loading branch information
eldenmoon committed Sep 4, 2024
1 parent e9025fd commit 2a389cd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions be/src/olap/rowset/segment_v2/segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ Status Segment::_create_column_readers(const SegmentFooterPB& footer) {
vectorized::PathInData path;
path.from_protobuf(spase_column_pb.column_path_info());
// Read from root column, so reader is nullptr
_sparse_column_tree[column.unique_id()].add(
_sparse_column_tree[unique_id].add(
path.copy_pop_front(),
SubcolumnReader {nullptr,
vectorized::DataTypeFactory::instance().create_data_type(
Expand Down Expand Up @@ -562,9 +562,10 @@ Status Segment::new_column_iterator_with_path(const TabletColumn& tablet_column,
const auto* node = tablet_column.has_path_info()
? _sub_column_tree[unique_id].find_exact(relative_path)
: nullptr;
const auto* sparse_node = tablet_column.has_path_info()
? _sparse_column_tree[unique_id].find_exact(relative_path)
: nullptr;
const auto* sparse_node =
tablet_column.has_path_info() && _sparse_column_tree.contains(unique_id)
? _sparse_column_tree[unique_id].find_exact(relative_path)
: nullptr;
// Currently only compaction and checksum need to read flat leaves
// They both use tablet_schema_with_merged_max_schema_version as read schema
auto type_to_read_flat_leaves = [](ReaderType type) {
Expand Down

0 comments on commit 2a389cd

Please sign in to comment.