diff --git a/backends-clickhouse/src/main/scala/org/apache/gluten/execution/CHHashJoinExecTransformer.scala b/backends-clickhouse/src/main/scala/org/apache/gluten/execution/CHHashJoinExecTransformer.scala index e3092f8bbd105..ed823359e9f69 100644 --- a/backends-clickhouse/src/main/scala/org/apache/gluten/execution/CHHashJoinExecTransformer.scala +++ b/backends-clickhouse/src/main/scala/org/apache/gluten/execution/CHHashJoinExecTransformer.scala @@ -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( diff --git a/cpp-ch/local-engine/Parser/JoinRelParser.cpp b/cpp-ch/local-engine/Parser/JoinRelParser.cpp index b217a9bd9da2c..e23d07dcc793a 100644 --- a/cpp-ch/local-engine/Parser/JoinRelParser.cpp +++ b/cpp-ch/local-engine/Parser/JoinRelParser.cpp @@ -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()); @@ -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); @@ -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; } diff --git a/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp b/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp index d0924a745716f..467fd48b6f903 100644 --- a/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp +++ b/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp @@ -122,7 +122,7 @@ 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; @@ -130,7 +130,7 @@ void logDebugMessage(const google::protobuf::Message & message, const char * typ 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); } } diff --git a/gluten-core/src/main/scala/org/apache/gluten/extension/columnar/OffloadSingleNode.scala b/gluten-core/src/main/scala/org/apache/gluten/extension/columnar/OffloadSingleNode.scala index 2b61c6935b3e4..efe4618ccf776 100644 --- a/gluten-core/src/main/scala/org/apache/gluten/extension/columnar/OffloadSingleNode.scala +++ b/gluten-core/src/main/scala/org/apache/gluten/extension/columnar/OffloadSingleNode.scala @@ -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,