Skip to content

Commit

Permalink
[opt](join) Check the property of nullable from intermediate row
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhhsg committed Dec 5, 2024
1 parent ab29448 commit 40a8ee4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions be/src/pipeline/exec/hashjoin_probe_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "hashjoin_probe_operator.h"

#include <gen_cpp/PlanNodes_types.h>

#include <string>

#include "common/cast_set.h"
Expand Down Expand Up @@ -623,8 +625,18 @@ Status HashJoinProbeOperatorX::open(RuntimeState* state) {
continue;
}

auto data_type_non_nullable = vectorized::remove_nullable(data_type);
if (data_type_non_nullable->equals(*target_data_type)) {
/// For outer join(left/right/full), the non-nullable columns may be converted to nullable.
const auto accept_nullable_not_match =
_join_op == TJoinOp::FULL_OUTER_JOIN ||
(idx < right_col_idx ? _join_op == TJoinOp::RIGHT_OUTER_JOIN
: _join_op == TJoinOp::LEFT_OUTER_JOIN);

if (accept_nullable_not_match) {
auto data_type_non_nullable = vectorized::remove_nullable(data_type);
if (data_type_non_nullable->equals(*target_data_type)) {
continue;
}
} else if (data_type->equals(*target_data_type)) {
continue;
}

Expand Down

0 comments on commit 40a8ee4

Please sign in to comment.