You want array_contains():

where array_contains('cats'::variant, column2)
Answer from Gordon Linoff on Stack Overflow
🌐
Snowflake Documentation
docs.snowflake.com › en › sql-reference › functions › array_except
ARRAY_EXCEPT | Snowflake Documentation
This function returns an ARRAY that contains the elements from source_array that are not in array_of_elements_to_exclude.
🌐
DataSunrise
datasunrise.com › home › simplify data analysis in snowflake with the filter function
Snowflake FILTER | Knowledge Center
May 20, 2025 - The result is an array containing only the elements that satisfy the condition. The return type of data in the SELECT statement is identical to the input data type used in the FILTER function. Lambda expressions in Snowflake are a useful tool that lets users create and use unnamed functions ...
🌐
Reddit
reddit.com › r/sql › snowflake: can we filter out dates from a list?
r/SQL on Reddit: Snowflake: can we filter out dates from a list?
July 21, 2023 -

Hi everyone,

This one is giving me a hard time...

Is anyone able to filter a list of dates?

Example:

  • I have the array below:

select array_construct(  '2023-05-06', '2023-05-08', '2023-05-09', '2023-05-13', '2023-05-15', '2023-05-16', '2023-05-17') as my_array
  • I would like to filter out the dates that are (strictly) before '2023-05-10': ['2023-05-13', '2023-05-15', '2023-05-16', '2023-05-17']

Considerations

  • I do not need to worry about duplicate values, it will always be unique dates.

  • Dates will also be sorted.

  • The date parameter I will use to filter out is not always part of the array.

Any help is appreciated, thank you! and happy Friday :)

Find elsewhere
🌐
Y42
y42.com › learn › snowflake › array_contains
Snowflake ARRAY_CONTAINS | How-to Guide with Examples | Y42 Learning hub
Learn how to use Snowflake’s ARRAY_CONTAINS function to check for the presence of a value within an array. Includes syntax details, usage notes, and practical examples for array search operations.
🌐
CastorDoc
castordoc.com › how-to › how-to-use-array-contains-in-snowflake
How to use array contains in Snowflake?
SELECT * FROM my_table WHERE ARRAY_CONTAINS(tags, 'snowflake'); In this query, the 'Array Contains' function is used to filter the rows from the 'my_table' table where the 'tags' array contains the value 'snowflake'.
🌐
Snowflake
snowflake.com › en › engineering-blog › reduce-function-simplify-array-processing
Simplify Array Processing with Snowflake's New Higher-Order Function
Snowflake's new REDUCE function, a higher-order SQL feature that streamlines complex array processing, boosts performance, and simplifies data transformations.
🌐
Snowflake Community
community.snowflake.com › 0D5VI00000DghjT0AR
Snowflake Community
Join our community of data professionals to learn, connect, share and innovate together
🌐
Medium
medium.com › snowflake › making-the-most-of-filters-in-snowflake-cortex-search-1d4c03b05ed3
Making the Most of Filters in Snowflake Cortex Search | by James Cha-Earley | Snowflake Builders Blog: Data Engineers, App Developers, AI, & Data Science | Medium
March 6, 2025 - CREATE CORTEX SEARCH SERVICE mysvc ON transcript_text -- The text column to search ATTRIBUTES region, agent_id, tags -- Columns you can filter on WAREHOUSE = mywh TARGET_LAG = '1 hour' AS ( SELECT transcript_text, date, region, agent_id, tags -- This would be an ARRAY type column FROM support_db.public.transcripts_etl ); With this setup, all the columns listed in the ATTRIBUTES clause become available for filtering in your search queries. When using Snowflake’s Cortex Search, you interact with it through a search service API.
🌐
Medium
medium.com › snowflake › matching-trinos-array-functions-in-snowflake-9b30a126573f
Matching Trino’s Array Functions in Snowflake | by Dylan Kaufman | Snowflake Builders Blog: Data Engineers, App Developers, AI, & Data Science | Medium
November 10, 2024 - CONTAINS: Snowflake’s function is ARRAY_CONTAINS, and the arguments are swapped (value to search for first in Snowflake). FILTER · FLATTEN: Snowflake calls this ARRAY_FLATTEN to distinguish it from the FLATTEN table function ·
🌐
Reddit
reddit.com › r/snowflake › [video] new in snowflake sql: filter and transform (and to tell you all about it, i wrote this song)
r/snowflake on Reddit: [video] New in Snowflake SQL: FILTER and TRANSFORM (and to tell you all about it, I wrote this song)
September 5, 2023 - Is it just me or are queries on snowflake quite slow? My team is running something as simple as (eg: select ... from activity where task_id = '.....' ) which fetches around 1 million rows and the query takes up to around 30plus seconds. We fetch only 8 fields + use material view.
🌐
Snowflake Documentation
docs.snowflake.com › en › user-guide › querying-semistructured
Querying Semi-structured Data | Snowflake Documentation
Snowflake higher-order functions enable you to use lambda functions to filter, reduce, and transform semi-structured and structured data. When you call a Snowflake higher-order function, you use a lambda expression to create the lambda function that operates on the data, which is specified ...