This message was deleted.
# general
s
This message was deleted.
c
the syntax for
STRING_AGG
is
Copy code
STRING_AGG(expr, separator, [size])
or
Copy code
STRING_AGG(DISTINCT expr, separator, [size])
if you want distinct values
1024 is the default value for the [size] parameter
a
yes am using the distinct one
is any config option there to change 1024?
c
unfortunately druid doesn’t currently support “growable” buffer aggs, so you sort of need to have an idea of how many bytes the strings which will be combined together will take up in memory per group
you can specify it as the optional 3rd parameter
e.g.
STRING_AGG(DISTINCT x, ',', 32768)
or whatever size you need
a
i tried by giving 2000... looks like not working
c
keep in mind that each grouping in the aggregate will need that many bytes, so be mindful of the amount of direct memory available to the process
a
hope 1024 is the max ? can't increase?
in 3rd optionm
c
it doesn’t know how many bytes there might be total, it fails fast
2000 should have given a slightly different error message than the default
a
oh... let me check that error then
c
you might need to adjust up until you find the number of bytes needed, and if the column has a very high cardinality it might not be possible
a
Thanks Clint, by increasing to 2000 working... i were tried with DISTINCT approximation as flase so different error came
once I enabled it, this STRING_AGG() with 2000 higher than default 1024 byte works
🙏 thank u
c
rad 👍