vibhatha commented on code in PR #13914:
URL: https://github.com/apache/arrow/pull/13914#discussion_r967117349
##########
cpp/src/arrow/engine/substrait/relation_internal.cc:
##########
@@ -338,15 +409,29 @@ Result<DeclarationInfo> FromProto(const substrait::Rel&
rel, const ExtensionSet&
if (!left_keys || !right_keys) {
return Status::Invalid("Left keys for join cannot be null");
}
+
+ // Create output schema from left, right relations and join keys
+ std::shared_ptr<Schema> join_schema = left.output_schema;
+ std::shared_ptr<Schema> right_schema = right.output_schema;
+
+ for (const auto& field : right_schema->fields()) {
+ ARROW_ASSIGN_OR_RAISE(
+ join_schema, join_schema->AddField(
+ static_cast<int>(join_schema->fields().size()) -
1, field));
+ }
Review Comment:
Thank you for catching this one.
--
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]