This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 6856b74e416 branch-3.0: [opt](join) Check the property of nullable
from intermediate row #45017 (#45475)
6856b74e416 is described below
commit 6856b74e416eb5144d994d4522dcdd9ccfefdb4b
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sun Jan 26 11:54:56 2025 +0800
branch-3.0: [opt](join) Check the property of nullable from intermediate
row #45017 (#45475)
Cherry-picked from #45017
Co-authored-by: Jerry Hu <[email protected]>
---
be/src/pipeline/exec/hashjoin_probe_operator.cpp | 29 ++++++++++++++++++------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/be/src/pipeline/exec/hashjoin_probe_operator.cpp
b/be/src/pipeline/exec/hashjoin_probe_operator.cpp
index d6286d9f8ff..c969f60fa72 100644
--- a/be/src/pipeline/exec/hashjoin_probe_operator.cpp
+++ b/be/src/pipeline/exec/hashjoin_probe_operator.cpp
@@ -17,6 +17,8 @@
#include "hashjoin_probe_operator.h"
+#include <gen_cpp/PlanNodes_types.h>
+
#include <string>
#include "common/logging.h"
@@ -645,21 +647,34 @@ Status HashJoinProbeOperatorX::open(RuntimeState* state) {
size_t idx = 0;
for (const auto* slot : slots_to_check) {
auto data_type = slot->get_data_type_ptr();
- auto target_data_type = idx < right_col_idx ?
_left_table_data_types[idx]
- :
_right_table_data_types[idx - right_col_idx];
+ const auto slot_on_left = idx < right_col_idx;
+ auto target_data_type = slot_on_left ? _left_table_data_types[idx]
+ : _right_table_data_types[idx -
right_col_idx];
++idx;
if (data_type->equals(*target_data_type)) {
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 ||
+ (slot_on_left ? _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;
}
- return Status::InternalError("intermediate slot({}) data type not
match: '{}' vs '{}'",
- slot->id(), data_type->get_name(),
- _left_table_data_types[idx]->get_name());
+ return Status::InternalError(
+ "Join node(id={}, OP={}) intermediate slot({}, #{})'s on {}
table data type not "
+ "match: '{}' vs '{}'",
+ _node_id, _join_op, slot->col_name(), slot->id(),
(slot_on_left ? "left" : "right"),
+ data_type->get_name(), target_data_type->get_name());
}
_build_side_child.reset();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]