Operator: AIFILTER
Description
The AIFILTER operator is a semantic boolean predicate that filters rows based on a natural-language condition. It specifies a column to which the condition is applied. This column must be of SQL type TEXT, and can contain multimodal (text-encoded) content such as images or audio data, in addition to pure text.
Syntax
To integrate the AI filter in an SQL query, use the syntax:
AIFILTER(<column>, '<natural_language_condition>')
The semantics of the parameters are as follows:
<column>: SQL column (TEXT) containing text, images, or audio data.<natural_language_condition>: text describing a filter condition in natural language.
The operator returns BOOLEAN (true/false) for each input row.
Example
The following query filters the cars_images table, containing car images in the content column, to include only images of red cars:
SELECT filename
FROM cars_images
WHERE AIFILTER(content, 'this is a red car');