westonpace commented on code in PR #15097:
URL: https://github.com/apache/arrow/pull/15097#discussion_r1061665219
##########
cpp/src/arrow/engine/substrait/serde_test.cc:
##########
@@ -216,6 +216,33 @@ void CheckRoundTripResult(const std::shared_ptr<Table>
expected_table,
compute::AssertTablesEqualIgnoringOrder(merged_expected, output_table);
}
+int CountProjectNodeOptionsInDeclarations(const compute::Declaration& input) {
+ int counter = 0;
+ if (input.factory_name == "project") {
+ counter++;
+ }
+ const auto& inputs = input.inputs;
+ for (const auto& in : inputs) {
+ return counter +
+
CountProjectNodeOptionsInDeclarations(std::get<compute::Declaration>(in));
+ }
+ return counter;
+}
+/// Validate the number of expected ProjectNodes when an emit is associated
with
+/// relations.
+void ValidateEmit(int expected_projections, const std::shared_ptr<Buffer>& buf,
Review Comment:
```suggestion
/// Validate the number of expected ProjectNodes
///
/// Project nodes are sometimes added by emit elements and we may want to
/// verify that we are not adding too many
void ValidateNumProjectNodes(int expected_projections, const
std::shared_ptr<Buffer>& buf,
```
I think we should be more direct with the naming. This method counts
project nodes whether they come from an emit or not.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]