How can I filter record from datasource with SQL q...
# ask-ai
b
How can I filter record from datasource with SQL query
u
Airbyte currently does not support the ability to load data from a custom SQL query as a source. The data is pulled directly from the table schema without an option to customize the query executed to pull the data [source](https://discuss.airbyte.io/t/620). However, you can filter records by adding a
record_filter
to the selector in the YAML file. The expression in the filter will be evaluated to a boolean returning true if the record should be included. Here is an example where all records with a
created_at
field greater than the stream slice's
start_time
will be filtered out:
Copy code
yaml selector:     extractor:       field_path: []     record_filter:       condition: "{{ record['created_at'] < stream_slice['start_time'] }}"
[source](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/record-selector#filtering-records) For more complex filtering, you might need to perform the filtering on the destination side after the data has been replicated.