You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jorisvandenbossche (via GitHub)" <gi...@apache.org> on 2023/03/23 07:34:38 UTC
[GitHub] [arrow] jorisvandenbossche commented on issue #34437: [R] Use FetchNode and OrderByNode
jorisvandenbossche commented on issue #34437:
URL: https://github.com/apache/arrow/issues/34437#issuecomment-1480719738
I was just testing the FetchNode in python, and at least for a Table source, I seem to get deterministic behaviour:
```python
import pyarrow as pa
from pyarrow._acero import TableSourceNodeOptions, FetchNodeOptions, Declaration
table = pa.table({'a': np.arange(10_000_000)})
table = pa.Table.from_batches(table.to_batches(max_chunksize=1_000_000))
for _ in range(100):
decl = Declaration.from_sequence([
Declaration("table_source", TableSourceNodeOptions(table)),
Declaration("fetch", FetchNodeOptions(0, 5))
])
assert decl.to_table()['a'].to_pylist() == [0, 1, 2, 3, 4]
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org