Consider the following example:
import frameless.functions.aggregate.{collectSet, max, min}
import frameless.syntax._
import frameless.TypedDataset
case class Foo(bar: Int)
val ds = TypedDataset.create(List.empty[Foo])
ds
.agg(
min(ds('bar)),
collectSet(ds('bar))
)
.collect
.run
It produces WrappedArray(null) while the expected value would be WrappedArray() because the initial dataset is empty.
Please note that this bug happen only when collectSet is combined with an other aggregation. Aggregating only with min produces the expected result.
While using only collectSet
ds.agg(collectSet(ds('bar))).collect.run
Produces WrappedArray(Vector()) while the expected value is WrappedArray()
I haven't tested with the other collect functions llke collectList
Consider the following example:
It produces
WrappedArray(null)while the expected value would beWrappedArray()because the initial dataset is empty.Please note that this bug happen only when
collectSetis combined with an other aggregation. Aggregating only withminproduces the expected result.While using only
collectSetProduces
WrappedArray(Vector())while the expected value isWrappedArray()I haven't tested with the other collect functions llke
collectList