rtpsw commented on code in PR #13880:
URL: https://github.com/apache/arrow/pull/13880#discussion_r946984793
##########
cpp/src/arrow/compute/exec/asof_join_node.cc:
##########
@@ -662,25 +858,67 @@ class AsofJoinNode : public ExecNode {
DCHECK_GE(inputs.size(), 2) << "Must have at least two inputs";
const auto& join_options = checked_cast<const
AsofJoinNodeOptions&>(options);
- ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Schema> output_schema,
- MakeOutputSchema(inputs, join_options));
+ if (join_options.tolerance < 0) {
+ return Status::Invalid("AsOfJoin tolerance must be non-negative but is ",
+ join_options.tolerance);
+ }
+
+ size_t n_input = inputs.size(), n_by = join_options.by_key.size();
+ std::vector<std::string> input_labels(n_input);
+ vec_col_index_t indices_of_on_key(n_input);
+ std::vector<vec_col_index_t> indices_of_by_key(n_input,
vec_col_index_t(n_by));
+ for (size_t i = 0; i < n_input; ++i) {
+ input_labels[i] = i == 0 ? "left" : "right_" + std::to_string(i);
+ const auto& input_schema = inputs[i]->output_schema();
+
+#define ASOFJOIN_KEY_MATCH(kopt, kacc)
\
Review Comment:
It converts the `on_key` and `by_key` field references in
`AsofJoinNodeOptions` into corresponding field indices; the former is a single
index while the latter is a vector, with multiple entries in case of a
multi-key. I'll check how to refactor this into clearer code.
--
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]