iChauster commented on code in PR #13771:
URL: https://github.com/apache/arrow/pull/13771#discussion_r935822680
##########
cpp/src/arrow/compute/exec/asof_join_node.cc:
##########
@@ -249,12 +263,25 @@ class InputState {
return updated;
}
- void Push(const std::shared_ptr<arrow::RecordBatch>& rb) {
+ Status Push(const std::shared_ptr<arrow::RecordBatch>& rb) {
if (rb->num_rows() > 0) {
+ // Batches must be in order
+ if (!Empty()) {
+ std::shared_ptr<arrow::RecordBatch> latest_batch = GetLatestBatch();
+ int64_t input_state_latest_time =
+ latest_batch->column_data(time_col_index_)
+ ->GetValues<int64_t>(1)[latest_batch->num_rows() - 1];
+ int64_t batch_earliest_time =
+ rb->column_data(time_col_index_)->GetValues<int64_t>(1)[0];
+ if (batch_earliest_time < input_state_latest_time) {
+ ARROW_RETURN_NOT_OK(Status::Invalid("Batches out of order."));
Review Comment:
We raise the Invalid case here, and the status is processed by
`ErrorIfNotOk` in `InputReceived`
--
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]