Sql error SelectionVectorMode - filter result from window function

Hi!

I writed an SQL that have a row_number function, and then i wanna filter by this number. When i not filter its works, but when I add my_row_number_col = 3 for exemple, I recive a error.

"Something went wrong"
"Serialization is only allowed for SelectionVectorMode.NONE. This was in  SelectionVectorMode.TWO_BYTE"

my source is a postgres.

actuly, I’m having alot trouble with window function. This sql have 3 window fuction, but if all three are in the same select, I recive an erro too. So a “split” into 3 subqueries and each one do one window function. But its not de case xD.

where ex SQL example:

select
   *
from(
   select
       row_number() over (partition by tb1.one_column order by tb1.other_column) as my_number,
       *
   from(
       .....SQL SQL and SQL......
    ) tb1
) tb2   
where
    tb2.my_number = 3

if I remove the tb2.my_number = 3, then it’s work, but I need filter =/

Can some one help me?

Hello @geovanif,

This appears to be an example of a known bug that we’ve identified. Can you please attach the profiles for the successful query and for the unsuccessful profile?

1 Like

I can’t response you from that other account. acctualy I cant response any post =’[

1fed3122-c2eb-43f4-b5a7-2416ec5afd75-success.zip (24,7,KB) 53033934-655b-4081-b986-2a29a7f8afbe-error.zip (24,7,KB)

1fed3122-c2eb-43f4-b5a7-2416ec5afd75-success.zip (24,7,KB) 53033934-655b-4081-b986-2a29a7f8afbe-error.zip (24,7,KB)

Any resolution for this issue? Facing the same issue when I add a WHERE clause after ranking
I am using Dremio version 4.7

     SELECT *
                FROM 
                (SELECT temp_105118269707834.*,
         rank()
                    OVER (
                ORDER BY  temp_105118269707834."total" DESC ) AS __rank
                FROM temp_105118269707834 AS temp_105118269707834 ) t
            WHERE t.__rank <= 3
        ORDER BY  t.__rank

@unni

Sorry, this is a 2 year old thread, are you able to attach the job profile?

@balaji.ramaswamy
I did not download the profile yesterday.
But the same query is working today !!!
3de19d5a-f86e-4adc-9e5e-fb870d1c7f7b.zip (34.1 KB)
Attaching the profile of the successful query.

Yesterday when I had removed WHERE t.__rank <= 3 from the query the query was working.