Skip to content

Add support for snowflake cluster by expressions #1882

Closed
@osipovartem

Description

@osipovartem
Contributor
CLUSTER BY (to_date(ts), coalesce(foo, 'bar'))

Failed with ParserError("Expected: ), found: (
https://docs.snowflake.com/en/user-guide/tables-clustering-keys#defining-a-clustering-key-for-a-table

We need to extend/change CreateTable cluster_by type from

pub cluster_by: Option<WrappedCollection<Vec<Ident>>>,

to

pub cluster_by: Option<WrappedCollection<Vec<Expr>>>,

This allows statements like CLUSTER BY (to_date(start_tstamp)) to be parsed correctly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @osipovartem

      Issue actions

        Add support for snowflake cluster by expressions · Issue #1882 · apache/datafusion-sqlparser-rs