alamb opened a new pull request, #5863:
URL: https://github.com/apache/arrow-datafusion/pull/5863

   # Which issue does this PR close?
   
   re #5772
   
   # Rationale for this change
   As I mentioned in 
https://github.com/apache/arrow-datafusion/pull/5772#pullrequestreview-1363813230
 , I found the cognitive load of dealing with 
`Vec<Option<Vec<PhysicalSortRequirements>>>>` challenging and the fact that 
`PhysicalSortRequirements` had another `Option` inside it was also challenging 
when reading the code .
   
   Also, it appears that the `make_sort_requirements_from_exprs` function was 
not public outside of the `datafusion-physical-expr` crate (so I could not used 
it while updating IOx -- see 
https://github.com/influxdata/influxdb_iox/pull/7440). It isn't hard to rewrite 
but I wanted to help others potentially upgrading by adding more comments and 
hints of how to create this type of structure.
   
   I also think having additional documentation (and method names that are self 
documenting)  adding methods makes the intent clearer when reading.
   
   
   # What changes are included in this PR?
   
   1. Make fields on `PhysicalSortRequirement` private
   2. Add doc strings and examples of what the different options are, and the 
relevant constructors
   3. Add `From` impls 
   
   # Are these changes tested?
   Covered by existing tests
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be 
updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api 
change` label.
   -->


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