Options

How to extend listagg() size,,

HyeontaeJuHyeontaeJu Vertica Customer

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

Answers

  • Options
    marcothesanemarcothesane - Select Field - Administrator

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

  • Options
    HyeontaeJuHyeontaeJu Vertica Customer

    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

  • Options
    marcothesanemarcothesane - Select Field - Administrator

    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
    ;

  • Options
    marcothesanemarcothesane - Select Field - Administrator

    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
    ;
    
  • Options
    HyeontaeJuHyeontaeJu Vertica Customer

    @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