wangyum commented on PR #40462:
URL: https://github.com/apache/spark/pull/40462#issuecomment-1484408565
rebalance before limit feels meaningless.
If the user really wants to take n rows from each partition, the SQL should
look like this:
```sql
SELECT *
FROM (SELECT *,
Row_number() OVER(partition BY pmod(Hash(id, 42), 200) ORDER
BY id) AS rn
FROM tbl)
WHERE rn <= 5;
```
--
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]