Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 2406b76

Browse files
yetiancntli2
authored andcommitted
Implement GetInfo for some classes in optimizer and planner (#1463)
1 parent 9c34fed commit 2406b76

36 files changed

+180
-53
lines changed

src/expression/abstract_expression.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ void AbstractExpression::DeduceExpressionName() {
9393
const std::string AbstractExpression::GetInfo(int num_indent) const {
9494
std::ostringstream os;
9595

96-
os << StringUtil::Indent(num_indent) << "Expression ::\n"
97-
<< StringUtil::Indent(num_indent + 1)
98-
<< "expression type = " << GetExpressionType() << ",\n"
96+
os << StringUtil::Indent(num_indent) << "-[Expression :: "
97+
<< GetExpressionType() << "]\n"
9998
<< StringUtil::Indent(num_indent + 1)
10099
<< "value type = " << type::Type::GetInstance(GetValueType())->ToString()
101100
<< ",\n";

src/expression/aggregate_expression.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ namespace expression {
1717

1818
const std::string AggregateExpression::GetInfo(int num_indent) const {
1919
std::ostringstream os;
20-
os << StringUtil::Indent(num_indent) << "Expression ::\n"
21-
<< StringUtil::Indent(num_indent + 1) << "expression type = Aggregate,\n"
20+
os << StringUtil::Indent(num_indent) << "-[Expression :: "
21+
<< "Aggregate]\n"
2222
<< StringUtil::Indent(num_indent + 1) << "aggregate type = " << expr_name_
2323
<< std::endl;
2424
for (const auto &child : children_) {

src/expression/case_expression.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ namespace expression {
1818
const std::string CaseExpression::GetInfo(int num_indent) const {
1919
std::ostringstream os;
2020

21-
os << StringUtil::Indent(num_indent) << "Expression ::\n"
22-
<< StringUtil::Indent(num_indent + 1) << "expression type = Case,\n"
21+
os << StringUtil::Indent(num_indent) << "-[Expression :: "
22+
<< "Case]\n"
2323
<< StringUtil::Indent(num_indent + 1) << "default: \n"
2424
<< default_expr_.get()->GetInfo(num_indent + 2);
2525

src/expression/comparison_expression.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ AbstractExpression *ComparisonExpression::Copy() const {
6363
const std::string ComparisonExpression::GetInfo(int num_indent) const {
6464
std::ostringstream os;
6565

66-
os << StringUtil::Indent(num_indent) << "Expression ::\n"
67-
<< StringUtil::Indent(num_indent + 1) << "expression type = Comparison,\n"
66+
os << StringUtil::Indent(num_indent) << "-[Expression :: "
67+
<< "Comparison]\n"
6868
<< StringUtil::Indent(num_indent + 1)
6969
<< "comparison type = " << ExpressionTypeToString(exp_type_) << "\n";
7070

src/expression/conjunction_expression.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ namespace expression {
1818
const std::string ConjunctionExpression::GetInfo(int num_indent) const {
1919
std::ostringstream os;
2020

21-
os << StringUtil::Indent(num_indent) << "Expression ::\n"
22-
<< StringUtil::Indent(num_indent + 1) << "expression type = Conjunction,\n"
21+
os << StringUtil::Indent(num_indent) << "-[Expression :: "
22+
<< "Conjunction]\n"
2323
<< StringUtil::Indent(num_indent + 1)
2424
<< "conjunction type = " << ExpressionTypeToString(exp_type_) << "\n";
2525

src/expression/constant_value_expression.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ namespace expression {
1818
const std::string ConstantValueExpression::GetInfo(int num_indent) const {
1919
std::ostringstream os;
2020

21-
os << StringUtil::Indent(num_indent) << "Expression ::\n"
22-
<< StringUtil::Indent(num_indent + 1)
23-
<< "expression type = Constant Value,\n"
21+
os << StringUtil::Indent(num_indent) << "-[Expression :: "
22+
<< "Constant Value]\n"
2423
<< StringUtil::Indent(num_indent + 1) << "value: " << value_.GetInfo()
2524
<< std::endl;
2625

src/expression/function_expression.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ void FunctionExpression::SetUDFFunctionExpressionParameters(
8484
const std::string FunctionExpression::GetInfo(int num_indent) const {
8585
std::ostringstream os;
8686

87-
os << StringUtil::Indent(num_indent) << "Expression ::\n"
88-
<< StringUtil::Indent(num_indent + 1) << "expression type = Function,\n"
87+
os << StringUtil::Indent(num_indent) << "-[Expression :: "
88+
<< "Function]\n"
8989
<< StringUtil::Indent(num_indent + 1) << "function name: " << func_name_
9090
<< "\n"
9191
<< StringUtil::Indent(num_indent + 1) << "function args: " << std::endl;

src/expression/operator_expression.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ namespace expression {
1818
const std::string OperatorExpression::GetInfo(int num_indent) const {
1919
std::ostringstream os;
2020

21-
os << StringUtil::Indent(num_indent) << "Expression ::\n"
22-
<< StringUtil::Indent(num_indent + 1) << "expression type = Operator,\n"
21+
os << StringUtil::Indent(num_indent) << "-[Expression :: "
22+
<< "Operator]\n"
2323
<< StringUtil::Indent(num_indent + 1)
2424
<< "operator name: " << ExpressionTypeToString(exp_type_) << std::endl;
2525

src/expression/parameter_value_expression.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ void ParameterValueExpression::VisitParameters(
7272
const std::string ParameterValueExpression::GetInfo(int num_indent) const {
7373
std::ostringstream os;
7474

75-
os << StringUtil::Indent(num_indent) << "Expression ::\n"
76-
<< StringUtil::Indent(num_indent + 1)
77-
<< "expression type = Parameter Value,\n"
75+
os << StringUtil::Indent(num_indent) << "-[Expression :: "
76+
<< "Parameter Value]\n"
7877
<< StringUtil::Indent(num_indent + 1)
7978
<< "value index: " << std::to_string(value_idx_)
8079
<< StringUtil::Indent(num_indent + 1)

src/expression/star_expression.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ namespace expression {
2020
const std::string StarExpression::GetInfo(int num_indent) const {
2121
std::ostringstream os;
2222

23-
os << StringUtil::Indent(num_indent) << "Expression ::\n"
24-
<< StringUtil::Indent(num_indent + 1) << "expression type = Star,"
23+
os << StringUtil::Indent(num_indent) << "-[Expression :: "
24+
<< "Star]"
2525
<< std::endl;
2626

2727
return os.str();

0 commit comments

Comments
 (0)