zhengruifeng opened a new pull request, #36908:
URL: https://github.com/apache/spark/pull/36908

   ### What changes were proposed in this pull request?
   1, when ProjectExec's _projectList_ contains MonotonicallyIncreasingID, add 
a `RangePartitioning` to the  `outputPartitioning` and append a `SortOrder(..., 
Ascending, ...)` to the `outputOrdering`;
   2, when the expression is not `nullable`, skip the `nullOrdering` comparison 
in `SortOrder.satisfies` and `RangePartitioning.satisfies0`
   
   
   ### Why are the changes needed?
   
   In Pandas-API-on-Spark:
   1, _MonotonicallyIncreasingID_ and _AttachDistributedSequence_ are widely 
used as the indexing type for big tables, they naturally have 
**RangePartitioning** and **Ascending Ordering**.
   
   2, Sorting by index is a common scenario, such as:
        2.1 internally, _Window.orderBy(NATURAL_ORDER_COLUMN_NAME)_ is widely 
used in GroupBy, Rolling, Expanding, EWM, etc;
        2.2 the  _sort_index()_ should be a high frequently used function for 
end users;
   So we should make MonotonicallyIncreasingID and AttachDistributedSequence 
provide the RangePartitioning and Ascending Ordering, so that the optimizer can 
leverage them.
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   existing UT for now


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


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

Reply via email to