Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
lgbo-ustc committed Aug 16, 2024
1 parent 6c7edce commit 48ccb9e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ case class CHShuffledHashJoinExecTransformer(
super.doValidateInternal()
}
private val finalJoinType = JoinTypeTransform.toNativeJoinType(joinType)
override protected lazy val substraitJoinType: JoinRel.JoinType =
JoinTypeTransform.toSubstraitJoinType(joinType, buildSide == BuildRight)
override protected lazy val substraitJoinType: JoinRel.JoinType = {
val res = JoinTypeTransform.toSubstraitJoinType(joinType, buildSide == BuildRight)
logError(s"xxx join type from: $joinType:$buildSide to $res $needSwitchChildren")
res
}
}

case class CHBroadcastBuildSideRDD(
Expand Down
4 changes: 4 additions & 0 deletions cpp-ch/local-engine/Parser/JoinRelParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ void JoinRelParser::renamePlanColumns(DB::QueryPlan & left, DB::QueryPlan & righ

DB::QueryPlanPtr JoinRelParser::parseJoin(const substrait::JoinRel & join, DB::QueryPlanPtr left, DB::QueryPlanPtr right)
{
LOG_ERROR(getLogger("JoinRelParser"), "xxx left: {}", left->getCurrentDataStream().header.dumpStructure());
LOG_ERROR(getLogger("JoinRelParser"), "xxx right: {}", right->getCurrentDataStream().header.dumpStructure());
google::protobuf::StringValue optimization_info;
optimization_info.ParseFromString(join.advanced_extension().optimization().value());
auto join_opt_info = JoinOptimizationInfo::parse(optimization_info.value());
Expand All @@ -216,6 +218,7 @@ DB::QueryPlanPtr JoinRelParser::parseJoin(const substrait::JoinRel & join, DB::Q
}

auto table_join = createDefaultTableJoin(join.type(), join_opt_info.is_existence_join);
LOG_ERROR(getLogger("JoinRelParser"), "xxx join type: {}: {}", table_join->kind(), table_join->strictness());
DB::Block right_header_before_convert_step = right->getCurrentDataStream().header;
addConvertStep(*table_join, *left, *right);

Expand Down Expand Up @@ -355,6 +358,7 @@ DB::QueryPlanPtr JoinRelParser::parseJoin(const substrait::JoinRel & join, DB::Q
existenceJoinPostProject(*query_plan, left_names);
}

LOG_ERROR(getLogger("JoinRelParser"), "xxx join result: {}", query_plan->getCurrentDataStream().header.dumpStructure());
return query_plan;
}

Expand Down
4 changes: 2 additions & 2 deletions cpp-ch/local-engine/Parser/SerializedPlanParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ std::string join(const ActionsDAG::NodeRawConstPtrs & v, char c)
void logDebugMessage(const google::protobuf::Message & message, const char * type)
{
auto * logger = &Poco::Logger::get("SerializedPlanParser");
if (logger->debug())
//if (logger->debug())
{
namespace pb_util = google::protobuf::util;
pb_util::JsonOptions options;
std::string json;
auto s = pb_util::MessageToJsonString(message, &json, options);
if (!s.ok())
throw Exception(ErrorCodes::LOGICAL_ERROR, "Can not convert {} to Json", type);
LOG_DEBUG(logger, "{}:\n{}", type, json);
LOG_INFO(logger, "{}:\n{}", type, json);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ case class OffloadJoin() extends OffloadSingleNode with LogLevelUtil {
val left = plan.left
val right = plan.right
logDebug(s"Columnar Processing for ${plan.getClass} is currently supported.")
plan.logicalLink match {
case Some(join: Join) =>
logError(s"xxx ${join.left.stats}, ${join.right.stats}")
case _ =>
}
logError(s"xxx join type ${plan.joinType}, ${plan.buildSide}")
BackendsApiManager.getSparkPlanExecApiInstance
.genShuffledHashJoinExecTransformer(
plan.leftKeys,
Expand Down

0 comments on commit 48ccb9e

Please sign in to comment.