We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


How to extend listagg() size,, — Vertica Forum

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

  • marcothesanemarcothesane - Select Field - Administrator

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

  • 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

  • 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
    ;

  • 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
    ;
    
  • 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