Skip to content

Commit

Permalink
[CH-375] Fix create nullable column used ColumnInt8 (#376)
Browse files Browse the repository at this point in the history
Co-authored-by: shuai.li <[email protected]>
  • Loading branch information
loneylee and shuai.li authored Mar 29, 2023
1 parent 355a070 commit 6aad021
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion utils/local-engine/Operator/ExpandStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ DB::Block ExpandStep::buildOutputHeader(
cols.push_back(old_col);
else
{
auto null_map = DB::ColumnInt8::create(0, 0);
auto null_map = DB::ColumnUInt8::create(0, 0);
auto null_col = DB::ColumnNullable::create(old_col.column, std::move(null_map));
auto null_type = std::make_shared<DB::DataTypeNullable>(old_col.type);
cols.push_back(DB::ColumnWithTypeAndName(null_col, null_type, old_col.name));
Expand Down
4 changes: 2 additions & 2 deletions utils/local-engine/Operator/ExpandTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void ExpandTransform::work()
// the output columns should all be nullable.
if (!sets.contains(i))
{
auto null_map = DB::ColumnInt8::create(rows, 1);
auto null_map = DB::ColumnUInt8::create(rows, 1);
auto col = DB::ColumnNullable::create(original_col, std::move(null_map));
cols.push_back(std::move(col));
}
Expand All @@ -96,7 +96,7 @@ void ExpandTransform::work()
cols.push_back(original_col);
else
{
auto null_map = DB::ColumnInt8::create(rows, 0);
auto null_map = DB::ColumnUInt8::create(rows, 0);
auto col = DB::ColumnNullable::create(original_col, std::move(null_map));
cols.push_back(std::move(col));
}
Expand Down

0 comments on commit 6aad021

Please sign in to comment.