Skip to content

Plan fails with option --select-model after making a change #5818

@cams-data

Description

@cams-data

I'm running the following command: uv run sqlmesh plan --select-model "ch_bronze_nz_stats.areas__regional_council_clipped" -vv after making changes to ch_bronze_nz_stats.areas__regional_council_clipped

And am getting:
Updating virtual layer ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━ 92.3% • 24/26 • 0:00:01
Error: Execution failed for node SnapshotId<"ch_silver_geography"."geographic_area_shapes": 1549095793>

"ch_silver_geography"."geographic_area_shapes" is downstream of "ch_bronze_nz_stats.areas__regional_council_clipped"

When I inspect the logs I can see:
clickhouse_connect.driver.exceptions.DatabaseError: Received ClickHouse exception, code: 60, server response: Code: 60. DB::Exception: Unknown table expression identifier 'sqlmesh__ch_silver.ch_silver_geography__geographic_area_shapes__3267957768' in scope SELECT * FROM sqlmesh__ch_silver.ch_silver_geography__geographic_area_shapes__3267957768. (UNKNOWN_TABLE) (for url [redacted])
I have checked the database and can see that across all replicas sqlmesh__ch_silver.ch_silver_geography__geographic_area_shapes__3267957768 does not exist. So it seems the fingerprint for the downstream model has changed, but no physical table was created for it to match? I can see the old table in there sqlmesh__ch_silver.ch_silver_geography__geographic_area_shapes__3737929073

If I run the update without --select-model it works, but I had thought even with that option, downstream models that are indirectly affected, would update?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions