Skip to content

Commit

Permalink
Rename left to leftouter, right to rightouter for join kind enum (#7319)
Browse files Browse the repository at this point in the history
close #7309
  • Loading branch information
yibin87 authored Apr 19, 2023
1 parent a573c43 commit 9e0e128
Show file tree
Hide file tree
Showing 21 changed files with 185 additions and 185 deletions.
20 changes: 10 additions & 10 deletions dbms/src/DataStreams/HashJoinBuildBlockInputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ void HashJoinBuildBlockInputStream::appendInfo(FmtBuffer & buffer) const
{
static const std::unordered_map<ASTTableJoin::Kind, String> join_type_map{
{ASTTableJoin::Kind::Inner, "Inner"},
{ASTTableJoin::Kind::Left, "Left"},
{ASTTableJoin::Kind::Right, "Right"},
{ASTTableJoin::Kind::LeftOuter, "Left"},
{ASTTableJoin::Kind::RightOuter, "Right"},
{ASTTableJoin::Kind::Full, "Full"},
{ASTTableJoin::Kind::Cross, "Cross"},
{ASTTableJoin::Kind::Comma, "Comma"},
{ASTTableJoin::Kind::Anti, "Anti"},
{ASTTableJoin::Kind::LeftSemi, "Left_Semi"},
{ASTTableJoin::Kind::LeftAnti, "Left_Anti"},
{ASTTableJoin::Kind::Cross_Left, "Cross_Left"},
{ASTTableJoin::Kind::Cross_Right, "Cross_Right"},
{ASTTableJoin::Kind::LeftOuterSemi, "Left_Semi"},
{ASTTableJoin::Kind::LeftOuterAnti, "Left_Anti"},
{ASTTableJoin::Kind::Cross_LeftOuter, "Cross_Left"},
{ASTTableJoin::Kind::Cross_RightOuter, "Cross_Right"},
{ASTTableJoin::Kind::Cross_Anti, "Cross_Anti"},
{ASTTableJoin::Kind::Cross_LeftSemi, "Cross_LeftSemi"},
{ASTTableJoin::Kind::Cross_LeftAnti, "Cross_LeftAnti"},
{ASTTableJoin::Kind::Cross_LeftOuterSemi, "Cross_LeftSemi"},
{ASTTableJoin::Kind::Cross_LeftOuterAnti, "Cross_LeftAnti"},
{ASTTableJoin::Kind::NullAware_Anti, "NullAware_Anti"},
{ASTTableJoin::Kind::NullAware_LeftSemi, "NullAware_LeftSemi"},
{ASTTableJoin::Kind::NullAware_LeftAnti, "NullAware_LeftAnti"},
{ASTTableJoin::Kind::NullAware_LeftOuterSemi, "NullAware_LeftSemi"},
{ASTTableJoin::Kind::NullAware_LeftOuterAnti, "NullAware_LeftAnti"},
{ASTTableJoin::Kind::RightSemi, "RightSemi"},
{ASTTableJoin::Kind::RightAnti, "RightAnti"},
};
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Debug/MockExecutor/JoinBinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ ExecutorBinderPtr compileJoin(size_t & executor_index, ExecutorBinderPtr left, E
case ASTTableJoin::Kind::Inner:
tp = tipb::JoinType::TypeInnerJoin;
break;
case ASTTableJoin::Kind::Left:
case ASTTableJoin::Kind::LeftOuter:
tp = tipb::JoinType::TypeLeftOuterJoin;
break;
case ASTTableJoin::Kind::Right:
case ASTTableJoin::Kind::RightOuter:
tp = tipb::JoinType::TypeRightOuterJoin;
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Flash/Coprocessor/DAGQueryBlockInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void DAGQueryBlockInterpreter::handleJoin(const tipb::Join & join, DAGPipeline &
NamesAndTypes join_output_columns = tiflash_join.genJoinOutputColumns(left_input_header, right_input_header, match_helper_name);
/// add necessary transformation if the join key is an expression

bool is_tiflash_right_join = tiflash_join.isTiFlashRightJoin();
bool is_tiflash_right_join = tiflash_join.isTiFlashRightOuterJoin();

JoinNonEqualConditions join_non_equal_conditions;
// prepare probe side
Expand Down
38 changes: 19 additions & 19 deletions dbms/src/Flash/Coprocessor/JoinInterpreterHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,24 @@ std::pair<ASTTableJoin::Kind, size_t> getJoinKindAndBuildSideIndex(tipb::JoinTyp
{
static const std::unordered_map<tipb::JoinType, ASTTableJoin::Kind> equal_join_type_map{
{tipb::JoinType::TypeInnerJoin, ASTTableJoin::Kind::Inner},
{tipb::JoinType::TypeLeftOuterJoin, ASTTableJoin::Kind::Left},
{tipb::JoinType::TypeRightOuterJoin, ASTTableJoin::Kind::Right},
{tipb::JoinType::TypeLeftOuterJoin, ASTTableJoin::Kind::LeftOuter},
{tipb::JoinType::TypeRightOuterJoin, ASTTableJoin::Kind::RightOuter},
{tipb::JoinType::TypeSemiJoin, ASTTableJoin::Kind::Inner},
{tipb::JoinType::TypeAntiSemiJoin, ASTTableJoin::Kind::Anti},
{tipb::JoinType::TypeLeftOuterSemiJoin, ASTTableJoin::Kind::LeftSemi},
{tipb::JoinType::TypeAntiLeftOuterSemiJoin, ASTTableJoin::Kind::LeftAnti}};
{tipb::JoinType::TypeLeftOuterSemiJoin, ASTTableJoin::Kind::LeftOuterSemi},
{tipb::JoinType::TypeAntiLeftOuterSemiJoin, ASTTableJoin::Kind::LeftOuterAnti}};
static const std::unordered_map<tipb::JoinType, ASTTableJoin::Kind> cartesian_join_type_map{
{tipb::JoinType::TypeInnerJoin, ASTTableJoin::Kind::Cross},
{tipb::JoinType::TypeLeftOuterJoin, ASTTableJoin::Kind::Cross_Left},
{tipb::JoinType::TypeRightOuterJoin, ASTTableJoin::Kind::Cross_Right},
{tipb::JoinType::TypeLeftOuterJoin, ASTTableJoin::Kind::Cross_LeftOuter},
{tipb::JoinType::TypeRightOuterJoin, ASTTableJoin::Kind::Cross_RightOuter},
{tipb::JoinType::TypeSemiJoin, ASTTableJoin::Kind::Cross},
{tipb::JoinType::TypeAntiSemiJoin, ASTTableJoin::Kind::Cross_Anti},
{tipb::JoinType::TypeLeftOuterSemiJoin, ASTTableJoin::Kind::Cross_LeftSemi},
{tipb::JoinType::TypeAntiLeftOuterSemiJoin, ASTTableJoin::Kind::Cross_LeftAnti}};
{tipb::JoinType::TypeLeftOuterSemiJoin, ASTTableJoin::Kind::Cross_LeftOuterSemi},
{tipb::JoinType::TypeAntiLeftOuterSemiJoin, ASTTableJoin::Kind::Cross_LeftOuterAnti}};
static const std::unordered_map<tipb::JoinType, ASTTableJoin::Kind> null_aware_join_type_map{
{tipb::JoinType::TypeAntiSemiJoin, ASTTableJoin::Kind::NullAware_Anti},
{tipb::JoinType::TypeLeftOuterSemiJoin, ASTTableJoin::Kind::NullAware_LeftSemi},
{tipb::JoinType::TypeAntiLeftOuterSemiJoin, ASTTableJoin::Kind::NullAware_LeftAnti}};
{tipb::JoinType::TypeLeftOuterSemiJoin, ASTTableJoin::Kind::NullAware_LeftOuterSemi},
{tipb::JoinType::TypeAntiLeftOuterSemiJoin, ASTTableJoin::Kind::NullAware_LeftOuterAnti}};

const auto & join_type_map = [is_null_aware, join_keys_size]() {
if (is_null_aware)
Expand Down Expand Up @@ -92,10 +92,10 @@ std::pair<ASTTableJoin::Kind, size_t> getJoinKindAndBuildSideIndex(tipb::JoinTyp
size_t build_side_index = 0;
switch (kind)
{
case ASTTableJoin::Kind::Cross_Right:
case ASTTableJoin::Kind::Cross_RightOuter:
build_side_index = 0;
break;
case ASTTableJoin::Kind::Cross_Left:
case ASTTableJoin::Kind::Cross_LeftOuter:
build_side_index = 1;
break;
default:
Expand All @@ -116,14 +116,14 @@ std::pair<ASTTableJoin::Kind, size_t> getJoinKindAndBuildSideIndex(tipb::JoinTyp
if (tipb_join_type == tipb::JoinType::TypeAntiSemiJoin)
kind = ASTTableJoin::Kind::RightAnti;
break;
case ASTTableJoin::Kind::Left:
kind = ASTTableJoin::Kind::Right;
case ASTTableJoin::Kind::LeftOuter:
kind = ASTTableJoin::Kind::RightOuter;
break;
case ASTTableJoin::Kind::Right:
kind = ASTTableJoin::Kind::Left;
case ASTTableJoin::Kind::RightOuter:
kind = ASTTableJoin::Kind::LeftOuter;
break;
case ASTTableJoin::Kind::Cross_Right:
kind = ASTTableJoin::Kind::Cross_Left;
case ASTTableJoin::Kind::Cross_RightOuter:
kind = ASTTableJoin::Kind::Cross_LeftOuter;
break;
default:; // just `default`, for other kinds, don't need to change kind.
}
Expand Down Expand Up @@ -216,7 +216,7 @@ TiFlashJoin::TiFlashJoin(const tipb::Join & join_, bool is_test) // NOLINT(cppco

String TiFlashJoin::genMatchHelperName(const Block & header1, const Block & header2) const
{
if (!isLeftSemiFamily())
if (!isLeftOuterSemiFamily())
{
return "";
}
Expand Down
18 changes: 9 additions & 9 deletions dbms/src/Flash/Coprocessor/JoinInterpreterHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ struct JoinNonEqualConditions
/// Validate this JoinNonEqualConditions and return error message if any.
String validate(ASTTableJoin::Kind kind) const
{
if (unlikely(!left_filter_column.empty() && !isLeftJoin(kind)))
if (unlikely(!left_filter_column.empty() && !isLeftOuterJoin(kind)))
return "non left join with left conditions";
if (unlikely(!right_filter_column.empty() && !isRightJoin(kind)))
if (unlikely(!right_filter_column.empty() && !isRightOuterJoin(kind)))
return "non right join with right conditions";

if unlikely ((!other_cond_name.empty() || !other_eq_cond_from_in_name.empty()) && other_cond_expr == nullptr)
Expand Down Expand Up @@ -130,10 +130,10 @@ struct TiFlashJoin

ASTTableJoin::Strictness strictness;

/// (cartesian) (anti) left semi join.
bool isLeftSemiFamily() const { return join.join_type() == tipb::JoinType::TypeLeftOuterSemiJoin || join.join_type() == tipb::JoinType::TypeAntiLeftOuterSemiJoin; }
/// (cartesian) (anti) left outer semi join.
bool isLeftOuterSemiFamily() const { return join.join_type() == tipb::JoinType::TypeLeftOuterSemiJoin || join.join_type() == tipb::JoinType::TypeAntiLeftOuterSemiJoin; }

bool isSemiJoin() const { return join.join_type() == tipb::JoinType::TypeSemiJoin || join.join_type() == tipb::JoinType::TypeAntiSemiJoin || isLeftSemiFamily(); }
bool isSemiJoin() const { return join.join_type() == tipb::JoinType::TypeSemiJoin || join.join_type() == tipb::JoinType::TypeAntiSemiJoin || isLeftOuterSemiFamily(); }

const google::protobuf::RepeatedPtrField<tipb::Expr> & getBuildJoinKeys() const
{
Expand All @@ -155,12 +155,12 @@ struct TiFlashJoin
return build_side_index == 0 ? join.right_conditions() : join.left_conditions();
}

bool isTiFlashLeftJoin() const { return kind == ASTTableJoin::Kind::Left || kind == ASTTableJoin::Kind::Cross_Left; }
bool isTiFlashLeftOuterJoin() const { return kind == ASTTableJoin::Kind::LeftOuter || kind == ASTTableJoin::Kind::Cross_LeftOuter; }

/// Cross_Right join will be converted to Cross_Left join, so no need to check Cross_Right
bool isTiFlashRightJoin() const { return kind == ASTTableJoin::Kind::Right; }
/// Cross_RightOuter join will be converted to Cross_LeftOuter join, so no need to check Cross_RightOuter
bool isTiFlashRightOuterJoin() const { return kind == ASTTableJoin::Kind::RightOuter; }

/// return a name that is unique in header1 and header2 for left semi family join,
/// return a name that is unique in header1 and header2 for left outer semi family join,
/// return "" for everything else.
String genMatchHelperName(const Block & header1, const Block & header2) const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ TEST(JoinKindAndBuildIndexTestRunner, TestNullAwareJoins)
ASSERT_TRUE(result.first == ASTTableJoin::Kind::NullAware_Anti && result.second == 1);

result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeLeftOuterSemiJoin, 1, true, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::NullAware_LeftSemi && result.second == 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::NullAware_LeftOuterSemi && result.second == 1);

result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeAntiLeftOuterSemiJoin, 1, true, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::NullAware_LeftAnti && result.second == 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::NullAware_LeftOuterAnti && result.second == 1);

/// NullAware join, expect join keys > 0
try
Expand All @@ -55,9 +55,9 @@ TEST(JoinKindAndBuildIndexTestRunner, TestNullAwareJoins)
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeAntiSemiJoin, 0, true, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::NullAware_Anti && result.second == 0);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeLeftOuterSemiJoin, 0, true, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::NullAware_LeftSemi && result.second == 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::NullAware_LeftOuterSemi && result.second == 0);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeAntiLeftOuterSemiJoin, 0, true, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::NullAware_LeftAnti && result.second == 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::NullAware_LeftOuterAnti && result.second == 0);
}

TEST(JoinKindAndBuildIndexTestRunner, TestCrossJoins)
Expand All @@ -70,15 +70,15 @@ TEST(JoinKindAndBuildIndexTestRunner, TestCrossJoins)

/// Cross LeftOuterJoin, uses right table as build side only
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeLeftOuterJoin, 1, false, 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_Left && result.second == 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftOuter && result.second == 1);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeLeftOuterJoin, 0, false, 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_Left && result.second == 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftOuter && result.second == 1);

/// Cross RightOuterJoin, uses left table as build side only
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeRightOuterJoin, 0, false, 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_Left && result.second == 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftOuter && result.second == 0);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeRightOuterJoin, 1, false, 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_Left && result.second == 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftOuter && result.second == 0);

/// Cross Semi/Anti, uses right table as build side only
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeSemiJoin, 1, false, 0);
Expand All @@ -92,13 +92,13 @@ TEST(JoinKindAndBuildIndexTestRunner, TestCrossJoins)

/// Cross LeftOuter Semi/Anti, uses right table as build side only
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeLeftOuterSemiJoin, 1, false, 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftSemi && result.second == 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftOuterSemi && result.second == 1);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeLeftOuterSemiJoin, 0, false, 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftSemi && result.second == 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftOuterSemi && result.second == 0);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeAntiLeftOuterSemiJoin, 1, false, 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftAnti && result.second == 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftOuterAnti && result.second == 1);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeAntiLeftOuterSemiJoin, 0, false, 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftAnti && result.second == 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Cross_LeftOuterAnti && result.second == 0);
}

TEST(JoinKindAndBuildIndexTestRunner, TestEqualJoins)
Expand All @@ -111,15 +111,15 @@ TEST(JoinKindAndBuildIndexTestRunner, TestEqualJoins)

/// LeftOuterJoin
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeLeftOuterJoin, 1, false, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Left && result.second == 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::LeftOuter && result.second == 1);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeLeftOuterJoin, 0, false, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Right && result.second == 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::RightOuter && result.second == 0);

/// RightOuterJoin
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeRightOuterJoin, 0, false, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Left && result.second == 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::LeftOuter && result.second == 0);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeRightOuterJoin, 1, false, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::Right && result.second == 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::RightOuter && result.second == 1);

/// Semi/Anti
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeSemiJoin, 1, false, 1);
Expand All @@ -133,13 +133,13 @@ TEST(JoinKindAndBuildIndexTestRunner, TestEqualJoins)

/// LeftOuter Semi/Anti
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeLeftOuterSemiJoin, 1, false, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::LeftSemi && result.second == 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::LeftOuterSemi && result.second == 1);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeLeftOuterSemiJoin, 0, false, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::LeftSemi && result.second == 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::LeftOuterSemi && result.second == 0);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeAntiLeftOuterSemiJoin, 1, false, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::LeftAnti && result.second == 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::LeftOuterAnti && result.second == 1);
result = JoinInterpreterHelper::getJoinKindAndBuildSideIndex(tipb::JoinType::TypeAntiLeftOuterSemiJoin, 0, false, 1);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::LeftAnti && result.second == 0);
ASSERT_TRUE(result.first == ASTTableJoin::Kind::LeftOuterAnti && result.second == 0);
}

} // namespace tests
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Flash/Planner/Plans/PhysicalJoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ PhysicalPlanNodePtr PhysicalJoin::build(

/// add necessary transformation if the join key is an expression

bool is_tiflash_right_join = tiflash_join.isTiFlashRightJoin();
bool is_tiflash_right_join = tiflash_join.isTiFlashRightOuterJoin();

JoinNonEqualConditions join_non_equal_conditions;
// prepare probe side
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Flash/tests/gtest_join_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,13 +675,13 @@ try
request = context.scan("null_test", "t")
.join(context.scan("null_test", "null_table"), tipb::JoinType::TypeLeftOuterSemiJoin, {}, {}, {}, {cond}, {})
.build(context);
// the 4th col is left semi helper col.
// the 4th col is left outer semi helper col.
executeAndAssertColumnsEqual(request, {toNullableVec<Int32>({1, 2, 3, 4, 5, 6, 7, 8, 9, 0}), toNullableVec<Int32>({1, 1, 1, 1, 1, 1, 1, 2, 2, 2}), toNullableVec<Int32>({1, 1, 1, 1, 1, 2, 2, 2, 2, 2}), toNullableVec<Int8>({0, 0, 0, 0, 0, 0, 0, 0, 0, 0})});

request = context.scan("null_test", "t")
.join(context.scan("null_test", "null_table"), tipb::JoinType::TypeAntiLeftOuterSemiJoin, {}, {}, {}, {cond}, {})
.build(context);
// the 4th col is left semi helper col.
// the 4th col is left outer semi helper col.
executeAndAssertColumnsEqual(request, {toNullableVec<Int32>({1, 2, 3, 4, 5, 6, 7, 8, 9, 0}), toNullableVec<Int32>({1, 1, 1, 1, 1, 1, 1, 2, 2, 2}), toNullableVec<Int32>({1, 1, 1, 1, 1, 2, 2, 2, 2, 2}), toNullableVec<Int8>({1, 1, 1, 1, 1, 1, 1, 1, 1, 1})});
}

Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Interpreters/ExpressionActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void ExpressionAction::prepare(Block & sample_block)
/// in case of coprocessor task, the join is always not null, but if the query comes from
/// clickhouse client, the join maybe null, skip updating column type if join is null
// todo find a new way to update the column type so the type can always be updated.
if (join != nullptr && join->getKind() == ASTTableJoin::Kind::Right)
if (join != nullptr && join->getKind() == ASTTableJoin::Kind::RightOuter)
{
/// update the column type for left block
std::unordered_set<String> keys;
Expand Down
Loading

0 comments on commit 9e0e128

Please sign in to comment.