Feature request: add partition method to Sets utility class
See original GitHub issueThe utility class Sets
could use a new method <T> Set<Set<T>> partition(Set<T> set, int size)
, similar to the one in Lists
class. Such a method would be useful for various applications, e.g. for batch processing elements for which order is unspecified/unimportant, and I don’t think there is a straightforward way of achieving the same effect with Java 8 streams API.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Rules for Using the ADD Option for the Partitioning Levels of a ...
You can specify an ADD option for a partitioning level. The BIGINT number following the ADD keyword plus the number of partitions defined ......
Read more >Managing partitioned tables | BigQuery - Google Cloud
This document describes how to manage partitioned tables in BigQuery. Note: The information in Managing tables also applies to partitioned tables.
Read more >Database table partitioning - GitLab Docs
Table partitioning is a powerful database feature that allows a table's data to be split into smaller physical tables that act as a...
Read more >Data partitioning guidance - Azure Architecture Center
In this article, the term partitioning means the process of physically dividing data into separate data stores. It is not the same as...
Read more >VLDB and Partitioning Guide - Oracle Help Center
The following are operations supported on hybrid partitioned tables. Creating single level RANGE and LIST partitioning methods. Using ALTER TABLE .. DDLs such ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another complication:
Iterables.partition
can be done in a “mostly streaming” fashion, butSets.partition
would need to be done eagerly (or else inefficiently). That means that switching fromIterables.partition
toSets.partition
has performance implications – different (IIRC) from comparable switches like fromIterables.filter
toSets.filter
.I’m not sure why you wouldn’t write
I’m also a bit concerned about issues like Sets.partition(myTreeSet, batchSize) not being able to identify which set implementation to use. It’s not even clear what set implementation we’d want – immutable? LinkedHashSet? – where there’s no real ambiguity for lists.