rtpsw commented on code in PR #14385:
URL: https://github.com/apache/arrow/pull/14385#discussion_r994590711
##########
cpp/src/arrow/compute/exec/asof_join_node.cc:
##########
@@ -1030,6 +1031,32 @@ class AsofJoinNode : public ExecNode {
return match.indices()[0];
}
+ static Result<std::vector<col_index_t>> GetIndicesOfOnKey(
+ const std::vector<std::shared_ptr<Schema>>& input_schema, const
FieldRef& on_key) {
+ size_t n_input = input_schema.size();
+ std::vector<col_index_t> indices_of_on_key(n_input);
+ for (size_t i = 0; i < n_input; ++i) {
+ ARROW_ASSIGN_OR_RAISE(indices_of_on_key[i],
+ FindColIndex(*input_schema[i], on_key, "on"));
Review Comment:
The proto uses `Expression` to allow for various ways to specify the key; it
can be thought of as future-proof. We can choose which of these ways to support
in Arrow Substrait in a first version. The code here supports any kind of
`FieldRef`, be it named or indexed, that Arrow Substrait may set up. The Arrow
Substrait code only supports an indexed `FieldRef` (see
[here](https://github.com/apache/arrow/blob/e8d54ea765ae7ba63b8f42c29ec855d656e85dc8/cpp/src/arrow/engine/substrait/expression_internal.cc#L150)),
but it can be extended.
--
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]