You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "wjones127 (via GitHub)" <gi...@apache.org> on 2023/05/28 23:29:16 UTC

[GitHub] [arrow] wjones127 commented on pull request #35808: GH-34363: [C++] Use equal size parts in S3 upload for R2 compatibility

wjones127 commented on PR #35808:
URL: https://github.com/apache/arrow/pull/35808#issuecomment-1566303323

   ✅ I've tested this locally against S3 and R2 with the following script:
   
   ```python
   import pyarrow.fs as pa_fs
   import os
   
   # 25 MB across 7 pieces
   pieces = 7
   piece_size = 25 * 1024 * 1024 // pieces
   
   bucket_name = os.environ["OBJECT_STORE_BUCKET"]
   
   fs = pa_fs.S3FileSystem(
       access_key=os.environ["AWS_ACCESS_KEY_ID"],
       secret_key=os.environ["AWS_SECRET_ACCESS_KEY"],
       endpoint_override=os.environ.get("OBJECT_STORE_AWS_ENDPOINT"),
       region="us-west-2",
   )
   
   with fs.open_output_stream(f"{bucket_name}/my_test_file.txt") as f:
       for i in range(pieces):
           f.write(b"0" * piece_size)
   
   info = fs.get_file_info(f"{bucket_name}/my_test_file.txt")
   assert info.size == piece_size * pieces
   ```


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