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

   Intended usage:
   
   ```python
   import pyarrow as pa
   import pyarrow.parquet as pq
   import pyarrow.compute as pc
   
   tab = pa.table({
       'a': pa.array([1, 3, 2, 2]),
       'b': pa.array(['a', 'b', 'c', 'd'])
   })
   
   sort_keys = [('a', 'ascending'), ('b', 'descending')]
   sorted_tab = tab.sort_by(sort_keys)
   
   pq.write_table(tab, 'data.parquet', sorting_columns=sort_keys)
   
   metadata = pq.read_metadata('data.parquet')
   metadata.row_group(0).sorting_columns
   
   pq_file = pq.ParquetFile('data.parquet')
   sort_order, null_placement = pq_file.sort_order
   assert sort_order == sort_keys
   assert null_placement == "at_end"
   ```


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