zitan-guo opened a new issue, #35901:
URL: https://github.com/apache/arrow/issues/35901

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   
   Suppose we have a large array of binary strings
   ```
   import numpy as np
   import pyarrow as pa
   import pyarrow.csv as pcsv
   
   nparr = np.frombuffer(np.random.randint(65, 91, int(4E8), 'u1'), 'S4')
   ```
   We want to construct a FixedSizedBinaryArray and Table
   ```
   fixedarr = pa.array(nparr, pa.binary(4))
   fixedtable = pa.Table.from_arrays([fixedarr], names=['fixedsize'])
   ```
   
   Alternatively, construct a BinaryArray and Table
   ```
   binarr = pa.array(nparr, pa.binary())
   bintable = pa.Table.from_arrays([binarr], names=['binary'])
   ```
   Setting up the csv write option
   ```
   csvoption = pcsv.WriteOptions(include_header=False, batch_size=2048, 
delimiter='|', quoting_style='none')
   ```
   Writing the table containing BinaryArray works
   ```
   pcsv.write_csv(bintable, 'binary.csv', write_options=csvoption)
   ```
   
   But writing the table containing FixedSizedBinaryArray crashes after first 
`batch_size`
   ```
   pcsv.write_csv(fixedtable, 'fixedsize.csv', write_options=csvoption)
   ```
   Note both tables are compatible with `pyarrow.parquet.write_table` though.
   
   
   **Environment**: 
   Windows 10
   pyarrow 12.0.0
   Python 3.10.10
   
   
   ### Component(s)
   
   Python


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