Commits


Neal Richardson authored and Jonathan Keane committed 02f11b9cf58
ARROW-12763: [R] Optimize dplyr queries that use head/tail after arrange * Uses SelectKSinkNode for head/tail on sorted query. tail() is implemented by reversing the sort orders, taking the top K rows, and then reversing the resulting row order to match as if we had taken the (ordered) bottom K rows. * Some subtle differences in expectation: row order appears to be locally deterministic (within chunks), but SelectK doesn't necessarily follow that when there are ties. Also, missing value handling by SelectK doesn't match R's expectations--there may be a sort option that isn't handled the same way in the SelectK algorithm (I don't see anywhere else to pass in another option but maybe I missed it) Closes #11405 from nealrichardson/r-topk Authored-by: Neal Richardson <neal.p.richardson@gmail.com> Signed-off-by: Jonathan Keane <jkeane@gmail.com>