Skip to content

Clickhouse: Error: Failed to parse '(= toYYYYMM(time))' #5234

@andness

Description

@andness

I've hit this error from the sqlmesh run command in our staging environment, but I've also hit it at various times during development. After asking about it on Slack I was asked to see if I could reproduce. The full error is

Error: Failed to parse '(= toYYYYMM(time))' into <class 'sqlglot.expressions.PartitionedByProperty'>

I was planning to reproduce the uv run error, but since the model is INCREMENTAL_BY_TIME_RANGE the cron prevented me from using sqlmesh run. I decided to use sqlmesh destroy to start over, and that's when I hit it.

So here's what I did:

  1. Init a new sqlmesh project with the clickhouse dialect
  2. Add a single model
  3. Successfully run plan

The model contains this line:

  partitioned_by = toYYYYMM(time),

As far as I can tell this line is wrong, the correct syntax is:

  partitioned_by toYYYYMM(time),

i.e. without the =

But somehow it still gets past plan and presumably makes it into some kind of state as I'm now unable to destroy the project.

The project is now in this state locally, so if you have some instructions for what I should pull out I'll be happy to do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingEngine: ClickhouseIssues related to Clickhouse

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions