thisisnic commented on issue #44799:
URL: https://github.com/apache/arrow/issues/44799#issuecomment-7156125303

   I used an AI agent to rerun this on a current release, and I've reviewed the 
results.
   
   ----------------
   
   🤖 :
   
   This looks like the fragment metadata caching described in #37630: a dataset 
keeps each file's Parquet metadata after scanning it, and files with very small 
row groups have large metadata. `batch_readahead` and `fragment_readahead` 
don't affect that.
   
   Since 20.0.0 it can be turned off with `cache_metadata=False`:
   
   ```python
   scanner = data.scanner(
       batch_size=50,
       batch_readahead=1,
       fragment_readahead=1,
       cache_metadata=False,
   )
   ```
   
   On pyarrow 26.0.1 with 8 local files of 2000 row groups each, running the 
code above through `write_dataset`, peak RSS was 450 MB and still climbing per 
file without the option, and 242 MB and flat with it. That was on local files, 
not S3, so it may not account for all of the memory use you saw.
   


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