gitmodimo commented on code in PR #44083:
URL: https://github.com/apache/arrow/pull/44083#discussion_r1824710184


##########
python/pyarrow/acero.py:
##########
@@ -311,13 +313,18 @@ def _perform_join_asof(left_operand, left_on, left_by,
 
     # Add the join node to the execplan
     if isinstance(left_operand, ds.Dataset):
-        left_source = _dataset_to_decl(left_operand, use_threads=use_threads)
+        left_source = _dataset_to_decl(
+            left_operand,
+            use_threads=use_threads,
+            require_sequenced_output=True)
     else:
         left_source = Declaration(
             "table_source", TableSourceNodeOptions(left_operand),
         )
     if isinstance(right_operand, ds.Dataset):
-        right_source = _dataset_to_decl(right_operand, use_threads=use_threads)
+        right_source = _dataset_to_decl(
+            right_operand, use_threads=use_threads,
+            require_sequenced_output=True)

Review Comment:
   > Do you really need the dataset to be sequenced? I think all you need is 
implicit ordering (batch indices) so you can sequence the batches at any point 
down the pipeline (by your asof join node).
   
   True. But I don't think `require_sequenced_output` actually means batches 
should be produced by this node in order, but batches need to be sequenced (ie. 
have batch.index assigned). Current implementation _does_ produce batches in 
order as a side effect of indexing.
   
   In context of your [GH-26818](https://github.com/apache/arrow/pull/44470)
   Maybe the option `require_sequenced_output` should just be renamed to 
`implicit_ordering`?
   What would be the purpose of `require_sequenced_output!=implicit_ordering`?
   
   P.S. I think that the idea of "Dataset has implicit ordering" is not handled 
in arrow. There is no way to store ordering information in dataset and order is 
subjected to alphabetical ordering based on fragment filenames(which with 
default filename template is incorrect `part_1 -> part_10 -> part2 -> part_3` 
etc...). 



-- 
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]

Reply via email to