kevinjqliu commented on issue #1040: URL: https://github.com/apache/iceberg-python/issues/1040#issuecomment-2282921664
The code works correctly for 1 data file with a given limit. The bug is when there are 2 data files, which means 2 FileScanTasks. For example, given an iceberg table with 2 data files, each 100MB. Let's read with a limit of 1, `tbl.scan(limit=1). to_arrow_batch_reader()`. In this scenario, here's the order of events, * The first task will produce `batches` * The first `batch` is processed, and the limit is satisfied. * A slice of the `batch` is yielded * The `break` statement will break out of the inner loop (the `for batch in batches` loop) * **The next task will then be processed**, which will go through the above again and yield another slice -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org