Skip to content
Closed
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
5 changes: 5 additions & 0 deletions be/src/vec/exec/join/vhash_join_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,11 @@ Status HashJoinNode::pull(doris::RuntimeState* state, vectorized::Block* output_
_right_table_column_names[i]});
}

if (_is_outer_join) {
_resize_fill_tuple_is_null_column(block_rows, 1, 1);
_add_tuple_is_null_column(&temp_block);
}

{
SCOPED_TIMER(_join_filter_timer);
RETURN_IF_ERROR(
Expand Down
11 changes: 11 additions & 0 deletions be/src/vec/exec/join/vjoin_node_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ class VJoinNodeBase : public ExecNode {
[[nodiscard]] bool can_terminate_early() override { return _short_circuit_for_probe; }

protected:
void _resize_fill_tuple_is_null_column(size_t new_size, int left_flag, int right_flag) {
if (_is_outer_join) {
reinterpret_cast<vectorized::ColumnUInt8*>(_tuple_is_null_left_flag_column.get())
->get_data()
.resize_fill(new_size, left_flag);
reinterpret_cast<vectorized::ColumnUInt8*>(_tuple_is_null_right_flag_column.get())
->get_data()
.resize_fill(new_size, right_flag);
}
}

// Construct the intermediate blocks to store the results from join operation.
void _construct_mutable_join_block();
// Convert the intermediate blocks to the final result. For example, if the block from probe
Expand Down
12 changes: 0 additions & 12 deletions be/src/vec/exec/join/vnested_loop_join_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,18 +372,6 @@ void VNestedLoopJoinNode::_update_additional_flags(Block* block) {
}
}

void VNestedLoopJoinNode::_resize_fill_tuple_is_null_column(size_t new_size, int left_flag,
int right_flag) {
if (_is_outer_join) {
reinterpret_cast<ColumnUInt8*>(_tuple_is_null_left_flag_column.get())
->get_data()
.resize_fill(new_size, left_flag);
reinterpret_cast<ColumnUInt8*>(_tuple_is_null_right_flag_column.get())
->get_data()
.resize_fill(new_size, right_flag);
}
}

void VNestedLoopJoinNode::_add_tuple_is_null_column(Block* block) {
if (_is_outer_join) {
auto p0 = _tuple_is_null_left_flag_column->assume_mutable();
Expand Down
2 changes: 0 additions & 2 deletions be/src/vec/exec/join/vnested_loop_join_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ class VNestedLoopJoinNode final : public VJoinNodeBase {

Status _fresh_left_block(RuntimeState* state);

void _resize_fill_tuple_is_null_column(size_t new_size, int left_flag, int right_flag);

// add tuple is null flag column to Block for filter conjunct and output expr
void _update_additional_flags(Block* block);

Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/functions/if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class FunctionIf : public IFunction {
const ColumnWithTypeAndName& arg_cond,
const ColumnWithTypeAndName& arg_then,
const ColumnWithTypeAndName& arg_else, size_t result,
size_t input_rows_count, Status& status) {
size_t input_rows_count, Status& status) const {
bool then_is_null = arg_then.column->only_null();
bool else_is_null = arg_else.column->only_null();

Expand Down
8 changes: 7 additions & 1 deletion be/src/vec/utils/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ class VectorizedUtils {

static bool all_arguments_are_constant(const Block& block, const ColumnNumbers& args) {
for (const auto& arg : args) {
if (!is_column_const(*block.get_by_position(arg).column)) {
auto column = block.get_by_position(arg).column;
if (!column) {
throw Exception(
ErrorCode::INTERNAL_ERROR, "input column is nullptr, column={}, block={}",
block.get_by_position(arg).dump_structure(), block.dump_structure());
}
if (!is_column_const(*column)) {
return false;
}
}
Expand Down