Why does distinct
not always return a list?
In the example for distinct elements given:
extract first value by value from "ABBAAC"
when all items are equal, this provides a single element instead of a single element list. I don’t know why, but in my head it seems more flexible to return a single element list.
This is what i ended up using instead, since select always returns a list.
There is another workaround here since selecting the first element of each group in ()
will give (0)
, the default value, but at least that makes sense.
on uniq x do
if x~() () else
t:select list first value by value from x
t.c0
end
end