How to increase the number of expressions limit in snowflake?

Viewed 531

I am fairly new to snowflake, and I am trying to query and get the records of some 200,000 IDs/rows. But unfortunately the snowflake has a limit where the user can't put more than 16000 expressions in the list. My query looks like this:

SELECT
APP_ID
,APP_DT
FROM table 
WHERE APP_ID IN 
(
....
,...
,...
,...
.
.
.
.
,...
)

Unfortunately, I am getting a list of APP_IDs from someone in an excel, and this is the only way I could use the list to fetch information (WHERE IN - filter). But snowflake is also restricting me. Kindly let me know if there is way to temporary expand the upper limit so that I can download the data locally for all 200,000 app IDs at once. I tried making CTE/permanent tables but that's not changing the error. enter image description here

Any comment/help much appreciated. Thank you.

1 Answers

Please create a table with all the ids.

In this example, I have a table with more than a million ids, and the WHERE id IN() works without a problem:

select count(*) from (select id from ids_table)
-- 1056343
;
select sum(wikipedia_views)
from wikidata_people_views
where id in (select id from ids_table)
-- 15863585373
;
Related