How to extend listagg() size,,

Hi,,
I'm using a function listagg but, the error occuring,,
Output length exceeded the maximum length [max_length=1024]

Answers

  • Can you provide just one group of data that leads to this error, so we can investigate?

  • sorry,,, the data expose is security violation in company,,
    The situation is that i use group by and I use listagg
    for example
    a | a,b,c,d,e,f,dsf,sda,werew, ~~~, sfas, sadf (but, the data something long,, about max length is 2000 ~ 3000)
    How to solve this problem

  • Ok. then try:
    ```SQL
    SELECT
    grpcol
    , LISTAGG (
    DISTINCT instring
    USING PARAMETERS
    max_length=4096 -- increase as much as you need, but with care
    , on_overflow='TRUNCATE'
    ) AS outstring
    FROM input_table
    GROUP BY
    grpcol
    ;

  • edited, to make more readable:

    Ok. then try:

    SELECT
    grpcol
    , LISTAGG (
    DISTINCT instring
    USING PARAMETERS
    max_length=4096 -- increase as much as you need, but with care
    , on_overflow='TRUNCATE'
    ) AS outstring
    FROM input_table
    GROUP BY
    grpcol
    ;
    
  • @marcothesane
    Thank you very much. I want to thank you in my native language as well. "감사합니다."

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.