Skip to content

Commit

Permalink
Merge branch 'master' into refine-lm
Browse files Browse the repository at this point in the history
  • Loading branch information
Lloyd-Pottiger authored Apr 19, 2023
2 parents cfe190e + 9e0e128 commit 616fdea
Show file tree
Hide file tree
Showing 27 changed files with 214 additions and 200 deletions.
3 changes: 2 additions & 1 deletion dbms/src/Common/FailPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ namespace DB
M(random_pipeline_model_operator_run_failpoint) \
M(random_pipeline_model_cancel_failpoint) \
M(random_spill_to_disk_failpoint) \
M(random_restore_from_disk_failpoint)
M(random_restore_from_disk_failpoint) \
M(random_exception_when_connect_local_tunnel)
namespace FailPoints
{
#define M(NAME) extern const char(NAME)[] = #NAME "";
Expand Down
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
5 changes: 3 additions & 2 deletions dbms/src/Flash/FlashService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,9 @@ grpc::Status FlashService::GetTiFlashSystemTable(

try
{
ContextPtr ctx;
std::tie(ctx, std::ignore) = createDBContext(grpc_context);
auto [ctx, status] = createDBContext(grpc_context);
if (!status.ok())
return status;
ctx->setDefaultFormat("JSONCompact");
ReadBufferFromString in_buf(request->sql());
MemoryWriteBuffer out_buf;
Expand Down
1 change: 1 addition & 0 deletions dbms/src/Flash/Mpp/ExchangeReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ ExchangeReceiverBase<RPCContext>::ExchangeReceiverBase(
{
handleConnectionAfterException();
cancel();
waitAllConnectionDone();
thread_manager->wait();
}
catch (...)
Expand Down
9 changes: 8 additions & 1 deletion dbms/src/Flash/Mpp/GRPCReceiverContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

#include <Common/Exception.h>
#include <Common/FailPoint.h>
#include <Flash/Coprocessor/GenSchemaAndColumn.h>
#include <Flash/Mpp/GRPCCompletionQueuePool.h>
#include <Flash/Mpp/GRPCReceiverContext.h>
Expand Down Expand Up @@ -55,6 +56,11 @@ struct RpcTypeTraits<::mpp::EstablishMPPConnectionRequest>

namespace DB
{
namespace FailPoints
{
extern const char random_exception_when_connect_local_tunnel[];
} // namespace FailPoints

namespace
{
struct GrpcExchangePacketReader : public ExchangePacketReader
Expand Down Expand Up @@ -125,8 +131,9 @@ struct AsyncGrpcExchangePacketReader : public AsyncExchangePacketReader

void checkLocalTunnel(const MPPTunnelPtr & tunnel, const String & err_msg)
{
FAIL_POINT_TRIGGER_EXCEPTION(FailPoints::random_exception_when_connect_local_tunnel);
RUNTIME_CHECK_MSG(tunnel != nullptr, fmt::runtime(err_msg));
RUNTIME_CHECK_MSG(tunnel->isLocal(), "EstablishMPPConnectionLocal into a remote channel!");
RUNTIME_CHECK_MSG(tunnel->isLocal(), "Need a local tunnel, but get remote tunnel.");
}

} // namespace
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
Loading

0 comments on commit 616fdea

Please sign in to comment.