Skip to content

Commit

Permalink
fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
loneylee committed Nov 6, 2024
1 parent 15f9da6 commit 3daffcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cpp-ch/local-engine/Parser/SerializedPlanParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ std::string join(const ActionsDAG::NodeRawConstPtrs & v, char c)
return res;
}

void adjustOutput(const DB::QueryPlanPtr & query_plan, const substrait::PlanRel & root_rel)
void SerializedPlanParser::adjustOutput(const DB::QueryPlanPtr & query_plan, const substrait::PlanRel & root_rel) const
{
if (root_rel.root().names_size())
{
Expand All @@ -111,8 +111,8 @@ void adjustOutput(const DB::QueryPlanPtr & query_plan, const substrait::PlanRel
const auto cols = query_plan->getCurrentHeader().getNamesAndTypesList();
if (cols.getNames().size() != static_cast<size_t>(root_rel.root().names_size()))
{
debug::dumpPlan(*query_plan, true);
debug::dumpMessage(root_rel, "substrait::PlanRel", true);
debug::dumpPlan(*query_plan, true, log);
debug::dumpMessage(root_rel, "substrait::PlanRel", true, log);
throw Exception(
ErrorCodes::LOGICAL_ERROR,
"Missmatch result columns size. plan column size {}, subtrait plan name size {}.",
Expand All @@ -135,8 +135,8 @@ void adjustOutput(const DB::QueryPlanPtr & query_plan, const substrait::PlanRel
const auto & original_cols = original_header.getColumnsWithTypeAndName();
if (static_cast<size_t>(output_schema.types_size()) != original_cols.size())
{
debug::dumpPlan(*query_plan, true);
debug::dumpMessage(root_rel, "substrait::PlanRel", true);
debug::dumpPlan(*query_plan, true, log);
debug::dumpMessage(root_rel, "substrait::PlanRel", true, log);
throw Exception(
ErrorCodes::LOGICAL_ERROR,
"Missmatch result columns size. plan column size {}, subtrait plan output schema size {}, subtrait plan name size {}.",
Expand Down Expand Up @@ -184,7 +184,7 @@ void adjustOutput(const DB::QueryPlanPtr & query_plan, const substrait::PlanRel

QueryPlanPtr SerializedPlanParser::parse(const substrait::Plan & plan)
{
debug::dumpMessage(plan, "substrait::Plan");
debug::dumpMessage(plan, "substrait::Plan", false, log);
//parseExtensions(plan.extensions());
if (plan.relations_size() != 1)
throw Exception(ErrorCodes::BAD_ARGUMENTS, "too many relations found");
Expand All @@ -205,7 +205,7 @@ QueryPlanPtr SerializedPlanParser::parse(const substrait::Plan & plan)
PlanUtil::checkOuputType(*query_plan);
#endif

debug::dumpPlan(*query_plan);
debug::dumpPlan(*query_plan, false, log);
return query_plan;
}

Expand Down
1 change: 1 addition & 0 deletions cpp-ch/local-engine/Parser/SerializedPlanParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class SerializedPlanParser

private:
DB::QueryPlanPtr parseOp(const substrait::Rel & rel, std::list<const substrait::Rel *> & rel_stack);
void adjustOutput(const DB::QueryPlanPtr & query_plan, const substrait::PlanRel & root_rel) const;

LoggerPtr log;
std::vector<jobject> input_iters;
Expand Down

0 comments on commit 3daffcc

Please sign in to comment.