Introduction

Before you start retrieving data, there are two important things to consider: the configuration of the query files and the sources from which you will retrieve data.

File Requirements

Queries are stored in files, and here are the necessary specifications and options:

  • Source Files: Must be .sql.

  • Location: All query files should be placed in the queries directory. This includes nesting in any subdirectories under queries.

    queries/
    ├── my_first_query.sql
    └── product/
        └── active_users.sql
    
  • Naming: The .sql filename is the one you can use to reference one query in another. See Referencing other queries for more information.

  • Co-Location: .sql query files and .yaml source files must all reside within the queries directory or its subdirectories. See How to Configure Sources for more information.

    queries/
    └── product/
        ├── active_users.sql
        └── snowflake_product.yaml
    

Sources

Configuration

The first step is to configure a source. To learn more about how to do this, see How to configure Sources

Source Resolution

It is important understand the source resolution when creating a query. Check Source Resolution