Skip to content

Commit

Permalink
[Fix](Variant) fix variant with not null
Browse files Browse the repository at this point in the history
ignore null bitmap for not null and make subcolumn access slots always nullable
  • Loading branch information
eldenmoon committed Mar 14, 2024
1 parent 684766e commit f1f5f1d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
6 changes: 2 additions & 4 deletions be/src/olap/rowset/segment_v2/column_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1504,8 +1504,7 @@ Status VariantRootColumnIterator::next_batch(size_t* n, vectorized::MutableColum
}
}
// fill nullmap
if (root_column->is_nullable()) {
DCHECK(dst->is_nullable());
if (root_column->is_nullable() && dst->is_nullable()) {
vectorized::ColumnUInt8& dst_null_map =
assert_cast<vectorized::ColumnNullable&>(*dst).get_null_map_column();
vectorized::ColumnUInt8& src_null_map =
Expand Down Expand Up @@ -1538,8 +1537,7 @@ Status VariantRootColumnIterator::read_by_rowids(const rowid_t* rowids, const si
}
}
// fill nullmap
if (root_column->is_nullable()) {
DCHECK(dst->is_nullable());
if (root_column->is_nullable() && dst->is_nullable()) {
vectorized::ColumnUInt8& dst_null_map =
assert_cast<vectorized::ColumnNullable&>(*dst).get_null_map_column();
vectorized::ColumnUInt8& src_null_map =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,16 +287,19 @@ public SlotDescriptor createSlotDesc(TupleDescriptor tupleDesc, SlotReference sl
slotDescriptor.setLabel(slotReference.getName());
} else {
slotRef = new SlotRef(slotDescriptor);
if (slotReference.hasSubColPath()) {
slotDescriptor.setSubColLables(slotReference.getSubColPath());
slotDescriptor.setMaterializedColumnName(slotRef.getColumnName()
+ "." + String.join(".", slotReference.getSubColPath()));
}
}
slotRef.setTable(table);
slotRef.setLabel(slotReference.getName());
this.addExprIdSlotRefPair(slotReference.getExprId(), slotRef);
slotDescriptor.setIsNullable(slotReference.nullable());
if (slotReference.hasSubColPath()) {
slotDescriptor.setSubColLables(slotReference.getSubColPath());
slotDescriptor.setMaterializedColumnName(slotRef.getColumnName()
+ "." + String.join(".", slotReference.getSubColPath()));
// always nullable at present
slotDescriptor.setIsNullable(true);
} else {
slotDescriptor.setIsNullable(slotReference.nullable());
}
return slotDescriptor;
}

Expand Down
Loading

0 comments on commit f1f5f1d

Please sign in to comment.