Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of order execution when model selectors are applied #1354

Closed
drewbanin opened this issue Mar 16, 2019 · 0 comments
Closed

Out of order execution when model selectors are applied #1354

drewbanin opened this issue Mar 16, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@drewbanin
Copy link
Contributor

Issue

Issue description

When models are selected with --models, dbt can execute models in the incorrect order. This specifically occurs when a model which is not included in the run provides the transitive edge between two models which are included in the run.

Results

dbt ran the models in the wrong order. If this is the initial run, then dbt can fail with a "table does not exist" error. If it's a subsequent run, then the behavior is effectively undefined: The two models run in random order and can fail (or succeed) depending on the state of the database and how long the models take to run.

System information

The output of dbt --version:

0.12.2

The operating system you're running on: macOS, py27/36

Steps to reproduce

dbt init outoforder
cd outoforder
mkdir models/included models/excluded
echo "select 1 as id" > models/included/base.sql
echo "select * from {{ ref('excluded_model') }}" > models/included/debug.sql
echo "select * from {{ ref('base') }}" > models/excluded/excluded_model.sql

dbt run --models included.*

Note that when run multiple times, debug and base will run simultaneously whereas base should always run first.

@drewbanin drewbanin added the bug Something isn't working label Mar 16, 2019
@drewbanin drewbanin added this to the Wilt Chamberlain milestone Mar 16, 2019
@beckjake beckjake self-assigned this Mar 18, 2019
beckjake added a commit that referenced this issue Mar 19, 2019
…cution-on-model-select

Fix out of order execution on model select (#1354)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants