Version:

Project Structure

Details on the file structure generated upon initializing a new Profiles project.

This guide walks you through the Profiles project structure generated once you initialize a new project using the pb init command.

Initial project structure

After initializing a new Profiles project, you will see the following project folder structure:

.
├── logs/logfile.log
├── models/
│   ├── inputs.yaml
│   └── profiles.yaml
├── output/
├── .gitignore
├── pb_project.yaml
└── README.md
FolderDescription
logs/Stores the logfile.log file containing the logs from all pb runs.
models/Stores the inputs, profiles, sql_models, and macros YAML files.
output/Stores the compiled SQL files from each project run.

These files are then executed in your warehouse.
FileDescription
.gitignoreSpecifies the files that Git ignores.
pb_project.yamlProfiles project configuration.
README.mdOverview on using pb and the SQL queries for analysis.

Full project structure

After adding sql_models.yaml and macros.yaml files (if used), the project structure looks as follows:

.
├── logs/logfile.log
├── models/
│   ├── inputs.yaml
|   ├── macros.yaml
|   ├── profiles.yaml
│   └── sql_models.yaml
├── output/
├── .gitignore
├── pb_project.yaml
└── README.md

SQL output structure

Profiles projects are compiled into SQL files which are executed in your data warehouse.

These compiled SQL queries are stored in a hierarchy of folders in the output folder.

output/
└── <target>/
    └── seq_no/
        ├── 1/
        ├── 2/
        ├── ...
        └── latest/
            ├── compile/
            └── run/

The output folder contains folders for each warehouse connection target (for example, dev, prod, etc.).

Within each target folder is a seq_no folder containing separate folders for each sequence number (1, 2, 3, etc.), along with a latest symbolic link for the latest sequence number. The sequence number folders contain compile (compiled SQL files, staged for execution) and run (post execution SQL files) folders storing the SQL files and folders containing the SQL files.

Naming convention

The SQL files and folders containing SQL files are named in the following format: Material_<name>_<hash>_<seq_no>.

For example: Material_product_tier_32cf8f89_1



Questions? Contact us by email or on Slack