Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions be/src/exprs/vexpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1075,15 +1075,6 @@ Status VExpr::execute_column(VExprContext* context, const Block* block, const Se
auto result_type = execute_type(block);
if (result_type != nullptr) {
Status st = result_type->check_column(*result_column);
if (!st.ok()) {
// Nullable(T) may legitimately produce a non-nullable T column when all rows are
// non-null (use_default_implementation_for_nulls optimization). Allow this.
const auto* nullable_type =
check_and_get_data_type<DataTypeNullable>(result_type.get());
if (nullable_type && !check_and_get_column<ColumnNullable>(result_column.get())) {
st = nullable_type->get_nested_type()->check_column(*result_column);
}
}
if (!st.ok()) {
return Status::InternalError(
"Expr {} return column type mismatch: declared={}, actual={}", expr_name(),
Expand Down
7 changes: 3 additions & 4 deletions be/test/exprs/vexpr_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,11 +893,10 @@ TEST(VExprExecuteColumnTest, TypeMismatchFails) {
EXPECT_FALSE(st.ok());
}

TEST(VExprExecuteColumnTest, NullableTypeWithNonNullableColumnPasses) {
TEST(VExprExecuteColumnTest, NullableTypeWithNonNullableColumnFails) {
using namespace doris;
FakeVExpr expr;
// Declared type is Nullable(Int32) but result is Int32 (non-nullable).
// This mirrors the use_default_implementation_for_nulls optimization and must pass.
// Declared type is Nullable(Int32), so the result must carry a nullable column wrapper.
expr.set_data_type(std::make_shared<DataTypeNullable>(std::make_shared<DataTypeInt32>()));

auto col = ColumnInt32::create();
Expand All @@ -906,7 +905,7 @@ TEST(VExprExecuteColumnTest, NullableTypeWithNonNullableColumnPasses) {

ColumnPtr result;
auto st = expr.execute_column(nullptr, nullptr, nullptr, 1, result);
EXPECT_TRUE(st.ok());
EXPECT_FALSE(st.ok());
}

TEST(VExprExecuteColumnTest, ColumnNothingPassesTypeCheck) {
Expand Down
Loading