Skip to content

Commit

Permalink
[fix](null safe equal join) fix coredump if both sides of the conjunc…
Browse files Browse the repository at this point in the history
…t is not nullable apache#36263
  • Loading branch information
jacktengg committed Jun 19, 2024
1 parent c808275 commit d9ba514
Show file tree
Hide file tree
Showing 3 changed files with 368 additions and 1 deletion.
7 changes: 6 additions & 1 deletion be/src/vec/exec/join/vhash_join_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,12 @@ Status HashJoinNode::init(const TPlanNode& tnode, RuntimeState* state) {
_build_expr_ctxs.push_back(ctx);

bool null_aware = eq_join_conjunct.__isset.opcode &&
eq_join_conjunct.opcode == TExprOpcode::EQ_FOR_NULL;
eq_join_conjunct.opcode == TExprOpcode::EQ_FOR_NULL &&
// For a null safe equal join, FE may generate a plan that
// both sides of the conjuct are not nullable, we just treat it
// as a normal equal join conjunct.
(eq_join_conjunct.right.nodes[0].is_nullable ||
eq_join_conjunct.left.nodes[0].is_nullable);
_is_null_safe_eq_join.push_back(null_aware);

const bool build_side_nullable = _build_expr_ctxs.back()->root()->is_nullable();
Expand Down
5 changes: 5 additions & 0 deletions regression-test/data/query_p0/join/rqg/rqg12257/rqg12257.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !rqg12257 --

-- !rqg12257_2 --

Loading

0 comments on commit d9ba514

Please sign in to comment.