-
-
Notifications
You must be signed in to change notification settings - Fork 622
Closed
Labels
Description
I have five 1-element chunks and a maxFactor of 2.0, but with certain seeds rechunkRandomly emits all elements in a single chunk. The number of chunks in the input stream doesn't matter. If you have 10000 1-element chunks, you end up with a single 10000-element chunk.
val fiveChunks = Stream(1) ++ Stream(2) ++ Stream(3) ++ Stream(4) ++ Stream(5)
fiveChunks.rechunkRandomlyWithSeed(0.1, 2.0)(5).chunks.toList == List(Chunk(1,2,3,4,5))https://scastie.scala-lang.org/TqE3oVzwQ2asDEdW8rf3uA
Other example of a wrong result:
scala> (Stream(1,1) ++ Stream(2,2) ++ Stream(3,3) ++ Stream(4,4) ++ Stream(5,5)).rechunkRandomlyWithSeed(0.1, 2.0)(9).chunks.toList
val res16: List[fs2.Chunk[Int]] = List(Chunk(1), Chunk(1, 2, 2, 3, 3, 4, 4, 5, 5))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done