Skip to content

Commit

Permalink
Ran clang tidy.
Browse files Browse the repository at this point in the history
  • Loading branch information
EpsilonPrime committed Jul 5, 2023
1 parent d2e0648 commit 07fc316
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/substrait/textplan/StringManipulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ bool endsWith(std::string_view haystack, std::string_view needle) {
haystack.substr(haystack.size() - needle.size(), needle.size()) == needle;
}

} // namespace io::substrait::textplan
} // namespace io::substrait::textplan
2 changes: 1 addition & 1 deletion src/substrait/textplan/StringManipulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ bool startsWith(std::string_view haystack, std::string_view needle);
// Returns true if the string 'haystack' ends with the string 'needle'.
bool endsWith(std::string_view haystack, std::string_view needle);

} // namespace io::substrait::textplan
} // namespace io::substrait::textplan
9 changes: 5 additions & 4 deletions src/substrait/textplan/converter/PlanPrinterVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,10 @@ std::any PlanPrinterVisitor::visitReadRelation(
return "";
}

auto mainSymbol = symbolTable_->lookupSymbolByLocationAndType(PROTO_LOCATION(relation), SymbolType::kRelation);
auto mainSymbol = symbolTable_->lookupSymbolByLocationAndType(
PROTO_LOCATION(relation), SymbolType::kRelation);

auto symbols = symbolTable_->lookupSymbolsByLocation(
PROTO_LOCATION(*msg));
auto symbols = symbolTable_->lookupSymbolsByLocation(PROTO_LOCATION(*msg));
if (!symbols.empty()) {
text << " source " << symbols[0]->name << ";\n";
}
Expand Down Expand Up @@ -826,7 +826,8 @@ std::any PlanPrinterVisitor::visitAggregateRelation(
}
for (const auto& measure : relation.measures()) {
if (!measure.has_measure()) {
errorListener_->addError("Encountered aggregate measure without a measure function.");
errorListener_->addError(
"Encountered aggregate measure without a measure function.");
continue;
}
text << " measure {\n";
Expand Down
6 changes: 5 additions & 1 deletion src/substrait/textplan/parser/SubstraitPlanVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,11 @@ std::any SubstraitPlanVisitor::visitRoot_relation(
names.push_back(id->getText());
}
symbolTable_->defineSymbol(
kRootNames, Location(ctx), SymbolType::kRoot, SourceType::kUnknown, names);
kRootNames,
Location(ctx),
SymbolType::kRoot,
SourceType::kUnknown,
names);
return nullptr;
}

Expand Down
5 changes: 1 addition & 4 deletions src/substrait/textplan/tests/RoundtripTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ TEST_P(RoundTripBinaryToTextFixture, RoundTrip) {
ASSERT_THAT(
result,
::testing::AllOf(
ParsesOk(),
HasErrors({}),
AsBinaryPlan(
EqualsProto(normalizedPlan))))
ParsesOk(), HasErrors({}), AsBinaryPlan(EqualsProto(normalizedPlan))))
<< std::endl
<< "Intermediate result:" << std::endl
<< addLineNumbers(outputText) << std::endl
Expand Down

0 comments on commit 07fc316

Please sign in to comment.