aokolnychyi opened a new pull request #1373:
URL: https://github.com/apache/iceberg/pull/1373


   This WIP PR extends Iceberg metadata with a sort order and is supposed to 
replace the work in #589.
   
   The API currently looks like this:
   
   ```
   SortOrder.builderFor(schema)
       .withOrderId(3)
       .asc("y", NullOrder.NULLS_FIRST)
       .desc(Expressions.bucket("z", 4), NullOrder.NULLS_LAST)
       .build();
   ```
   
   The underlying representation looks like this:
   
   ```
      "default-sort-order-id": 3,
      "sort-orders": [
         {
            "order-id": 3,
            "fields": [
               {
                  "transform": "identity",
                  "source-id": 2,
                  "direction": "asc",
                  "null-order": "first"
               },
               {
                  "transform": "bucket[4]",
                  "source-id": 3,
                  "direction": "desc",
                  "null-order": "last"
               }
            ]
         }
      ],
   ```
   
   **TODO items**
   - Tests.
   
   **Open items**
   - Consider switching to a builder patter in `Catalog`.
   - Whether to reserve id 0 for the unsorted order.
   - Case sensitivity when binding `Term`s in `Builder`.
   
   **Follow-up items**
   - Associate data and delete files with sort order id.
   - An API for updating the current sort order in a table.
   
   


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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to