-
Notifications
You must be signed in to change notification settings - Fork 359
Closed
Labels
BugSomething isn't workingSomething isn't working
Description
Hi,
I am trying out SQLMesh, but ran into issues when using AWS Athena as a SQL engine. While following the quick start guide I get the error Error: Unsupported expression type Model when adding a new column.
I am using Version 0.205.0.
To reproduce
I did the following:
uv init
uv add sqlmesh
uv add "sqlmesh[athena]"
uv run sqlmesh init
Then I chose the following:
──────────────────────────────
Welcome to SQLMesh!
──────────────────────────────
What type of project do you want to set up?
[1] DEFAULT - Create SQLMesh example project models and files
[2] dbt - You have an existing dbt project and want to run it with SQLMesh
[3] EMPTY - Create a SQLMesh configuration file and project directories only
Enter a number: 1
──────────────────────────────
Choose your SQL engine:
[1] DuckDB
[2] Snowflake
[3] Databricks
[4] BigQuery
[5] MotherDuck
[6] ClickHouse
[7] Redshift
[8] Spark
[9] Trino
[10] Azure SQL
[11] MSSQL
[12] Postgres
[13] GCP Postgres
[14] MySQL
[15] Athena
[16] RisingWave
Enter a number: 15
──────────────────────────────
Choose your SQLMesh CLI experience:
[1] DEFAULT - See and control every detail
[2] FLOW - Automatically run changes and show summary output
Enter a number: 1
──────────────────────────────
Your SQLMesh project is ready!
Next steps:
• Run command in CLI to install your SQL engine's Python dependencies: pip install "sqlmesh[athena]"
• Update your gateway connection settings (e.g., username/password) in the project configuration file:
/home/stefan/Documents/playgrounds/sqlmesh/athena-issue/config.yaml
• Run command in CLI: sqlmesh plan
• (Optional) Explain a plan: sqlmesh plan --explain
Quickstart guide:
https://sqlmesh.readthedocs.io/en/stable/quickstart/cli/
Need help?
• Docs: https://sqlmesh.readthedocs.io
• Slack: https://www.tobikodata.com/slack
• GitHub: https://github.com/TobikoData/sqlmesh/issues
Afterwards I edited the config.yaml to include the following fields:
type: athena
work_group: primary
s3_staging_dir: s3://bucket/sqlmesh/output/
s3_warehouse_location: s3://bucket/sqlmesh/
After getting an AWS session I ran uv run sqlmesh plan, which worked as expected:
======================================================================
Successfully Ran 1 tests against duckdb in 0.12 seconds.
----------------------------------------------------------------------
[WARNING] The athena engine is not recommended for storing SQLMesh state in production deployments. Please see
https://sqlmesh.readthedocs.io/en/stable/guides/configuration/#state-connection for a list of recommended engines
and more information.
`prod` environment will be initialized
Models:
└── Added:
├── sqlmesh_example.full_model
├── sqlmesh_example.incremental_model
└── sqlmesh_example.seed_model
Models needing backfill:
├── sqlmesh_example.full_model: [full refresh]
├── sqlmesh_example.incremental_model: [2020-01-01 - 2025-07-29]
└── sqlmesh_example.seed_model: [full refresh]
Apply - Backfill Tables [y/n]: y
Updating physical layer ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 3/3 • 0:00:25
✔ Physical layer updated
[1/1] sqlmesh_example.seed_model [insert seed file] 3.23s
[1/1] sqlmesh_example.incremental_model [insert 2020-01-01 - 2025-07-29] 15.69s
[1/1] sqlmesh_example.full_model [full refresh, audits ✔1] 20.45s
Executing model batches ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 3/3 • 0:00:39
✔ Model batches executed
Updating virtual layer ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 3/3 • 0:00:08
✔ Virtual layer updated
But then when I changed the incremental_model.sql to have the new column:
MODEL (
name sqlmesh_example.incremental_model,
kind INCREMENTAL_BY_TIME_RANGE (
time_column event_date
),
start '2020-01-01',
cron '@daily',
grain (id, event_date)
);
SELECT
id,
item_id,
'z' AS new_column, -- Added column
event_date,
FROM
sqlmesh_example.seed_model
WHERE
event_date BETWEEN @start_date AND @end_date
and run uv run sqlmesh plan dev I get:
======================================================================
Successfully Ran 1 tests against duckdb in 0.04 seconds.
----------------------------------------------------------------------
[WARNING] The athena engine is not recommended for storing SQLMesh state in production deployments. Please see
https://sqlmesh.readthedocs.io/en/stable/guides/configuration/#state-connection for a list of recommended engines
and more information.
New environment `dev` will be created from `prod`
Differences from the `prod` environment:
Models:
├── Directly Modified:
│ └── sqlmesh_example__dev.incremental_model
└── Indirectly Modified:
└── sqlmesh_example__dev.full_model
Error: Unsupported expression type Model
I tried the same with the full_model.sql and using table_format: iceberg for all models, but always got the same error when adding a new column.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't working