westonpace commented on code in PR #13914:
URL: https://github.com/apache/arrow/pull/13914#discussion_r959817640
##########
cpp/src/arrow/engine/substrait/relation_internal.cc:
##########
@@ -199,12 +217,22 @@ Result<DeclarationInfo> FromProto(const substrait::Rel&
rel, const ExtensionSet&
std::move(filesystem),
std::move(files),
std::move(format), {}));
- ARROW_ASSIGN_OR_RAISE(auto ds,
ds_factory->Finish(std::move(base_schema)));
+ ARROW_ASSIGN_OR_RAISE(auto ds, ds_factory->Finish(base_schema));
- return DeclarationInfo{
- compute::Declaration{
- "scan", dataset::ScanNodeOptions{std::move(ds),
std::move(scan_options)}},
- num_columns};
+ if (HasEmit(read)) {
+ ARROW_ASSIGN_OR_RAISE(auto emit_expressions, GetEmitInfo(read,
base_schema));
+ return DeclarationInfo{
+ compute::Declaration::Sequence(
+ {{"scan",
+ dataset::ScanNodeOptions{std::move(ds),
std::move(scan_options)}},
+ {"project",
compute::ProjectNodeOptions{std::move(emit_expressions)}}}),
+ static_cast<int>(emit_expressions.size()), std::move(base_schema)};
+ } else {
Review Comment:
That is a correct interpretation.
--
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]