Error with IN expression


#1

Hi,
I’m trying to execute a query with an IN expression in which the sub query executes against another table.
I get an error
Exception occurred: type not serializable: [$cor0] (type com.google.common.collect.SingletonImmutableSet)
However if I put an actual list in (2,3,4) it works or if I execute the subquery against the same table it works (although meaningless)

Example:
I have a table called ids which holds a single column called id
executing the following results in an error:

select 
sum(t1.pass_yards) as pass_yards, 
sum(t1.rush_yards) as rush_yards, 
player_id, game_id 
from test_data t1 
where t1.id in (select id from ids) 
group by t1.player_id, t1.game_id;

results in Exception: Exception occurred: type not serializable: [$cor0] (type com.google.common.collect.SingletonImmutableSet)

However If I do the following:

select 
    sum(t1.pass_yards) as pass_yards, 
    sum(t1.rush_yards) as rush_yards, 
    player_id, game_id 
    from test_data t1 
    where t1.id in (1,3,5) 
    group by t1.player_id, t1.game_id;

everything works. Similarly if I do:
select
sum(t1.pass_yards) as pass_yards,
sum(t1.rush_yards) as rush_yards,
player_id, game_id
from test_data t1
where t1.id in (select id from test_data)
group by t1.player_id, t1.game_id;

everything works.
Any ideas why the first query fails with
Exception occurred: type not serializable: [$cor0] (type com.google.common.collect.SingletonImmutableSet)


#2

Hi @scottjustin5000, is there any chance this is a public dataset (or at least one you’d be able to share with me privately)?