alippai commented on issue #38818:
URL: https://github.com/apache/arrow/issues/38818#issuecomment-1821811099

   It happens with strings only, numbers work as expected. 
   
   I little bit ugly example:
   ```python
   pq.write_table(
       pa.Table.from_arrays(
           [
               pc.dictionary_encode(
                   pa.array(np.sort(pa.array(list(range(10000)) * 1000)), 
type=pa.int16())
               )
           ],
           None,
           pa.schema([pa.field("a", pa.dictionary(pa.int16(), pa.utf8()), 
False)]),
       ),
       "dict.parquet",
       data_page_version="2.0",
       row_group_size=10000,
       use_dictionary=["a"],
       compression="zstd",
       dictionary_pagesize_limit=100 * 1024 * 1024,
   )
   ```
   vs
   
   ```python
   pq.write_table(
       pa.Table.from_arrays(
           [pa.array(np.sort(pa.array(list(range(10000)) * 1000)), 
type=pa.int16()).cast(pa.utf8())],
           None,
           pa.schema([pa.field("a", pa.utf8(), False)]),
       ),
       "nodict.parquet",
       data_page_version="2.0",
       row_group_size=10000,
       use_dictionary=["a"],
       compression="zstd",
       dictionary_pagesize_limit=100*1024*1024
   )
   ```


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