Skip to content

Commit

Permalink
[Fix](Variant) fix variant with not null (#32248)
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 authored Mar 19, 2024
1 parent af4b422 commit 3d4af5c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 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 @@ -1508,8 +1508,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 @@ -1542,8 +1541,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 @@ -71,9 +71,10 @@ public static Expression rewriteToSlot(PushDownToProjectionFunction pushedFuncti
// avoid duplicated slots
return targetColumnSlot;
}
boolean nullable = true; // always nullable at present
SlotReference slotRef = new SlotReference(StatementScopeIdGenerator.newExprId(),
topColumnSlot.getName(), topColumnSlot.getDataType(),
topColumnSlot.nullable(), topColumnSlot.getQualifier(), topColumnSlot.getTable().get(),
nullable, topColumnSlot.getQualifier(), topColumnSlot.getTable().get(),
topColumnSlot.getColumn().get(), Optional.of(topColumnSlot.getInternalName()),
fullPaths);
ctx.addPathSlotRef(topColumnSlot, fullPaths, slotRef, pushedFunction);
Expand Down
Loading

0 comments on commit 3d4af5c

Please sign in to comment.