Skip to content

Commit

Permalink
fix(4paradigm#1761): problem one, explain require next <cr>
Browse files Browse the repository at this point in the history
also removed the <tab> indent from physical_plan_str
  • Loading branch information
aceforeverd committed May 13, 2022
1 parent 29bd02e commit 227bf57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion hybridse/src/vm/sql_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ bool SqlCompiler::Compile(SqlContext& ctx, Status& status) { // NOLINT

if (dump_plan_) {
std::stringstream physical_plan_ss;
ctx.physical_plan->Print(physical_plan_ss, "\t");
ctx.physical_plan->Print(physical_plan_ss, "");
ctx.physical_plan_str = physical_plan_ss.str();
}
ok = codec::SchemaCodec::Encode(ctx.schema, &ctx.encoded_schema);
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/sql_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void HandleSQL(const std::string& sql) {
while (result_set->Next()) {
std::string val;
result_set->GetAsString(0, val);
std::cout << val;
std::cout << val << std::endl;
}
} else {
::hybridse::base::TextTable t('-', ' ', ' ');
Expand Down
13 changes: 7 additions & 6 deletions src/sdk/sql_cluster_router.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1291,10 +1291,10 @@ std::shared_ptr<ExplainInfo> SQLClusterRouter::Explain(const std::string& db, co
}
::hybridse::sdk::SchemaImpl input_schema(explain_output.input_schema);
::hybridse::sdk::SchemaImpl output_schema(explain_output.output_schema);
std::shared_ptr<ExplainInfoImpl> impl(
new ExplainInfoImpl(input_schema, output_schema, explain_output.logical_plan, explain_output.physical_plan,
explain_output.ir, explain_output.request_db_name, explain_output.request_name));
return impl;

return std::make_shared<ExplainInfoImpl>(input_schema, output_schema, explain_output.logical_plan,
explain_output.physical_plan, explain_output.ir,
explain_output.request_db_name, explain_output.request_name);
}

std::shared_ptr<hybridse::sdk::ResultSet> SQLClusterRouter::CallProcedure(const std::string& db,
Expand Down Expand Up @@ -1800,7 +1800,7 @@ base::Status SQLClusterRouter::HandleSQLCreateTable(hybridse::node::CreatePlanNo
std::vector<std::shared_ptr<::openmldb::catalog::TabletAccessor>> all_tablet;
all_tablet = cluster_sdk_->GetAllTablet();
// set dafault value
uint32_t default_replica_num = std::min((uint32_t)all_tablet.size(), FLAGS_replica_num);
uint32_t default_replica_num = std::min(static_cast<uint32_t>(all_tablet.size()), FLAGS_replica_num);

hybridse::base::Status sql_status;
bool is_cluster_mode = cluster_sdk_->IsClusterMode();
Expand Down Expand Up @@ -3055,7 +3055,8 @@ hybridse::sdk::Status SQLClusterRouter::GetNewIndex(
// update ttl
auto ns_ptr = cluster_sdk_->GetNsClient();
std::string err;
bool ok = ns_ptr->UpdateTTL(table_name, type, new_abs_ttl, new_lat_ttl, column_key.index_name(), err);
bool ok =
ns_ptr->UpdateTTL(table_name, type, new_abs_ttl, new_lat_ttl, column_key.index_name(), err);
if (!ok) {
return {::hybridse::common::StatusCode::kCmdError, "update ttl failed"};
}
Expand Down

0 comments on commit 227bf57

Please sign in to comment.