Skip to content

Unable to query by partition column  #1445

@ChewingGlass

Description

@ChewingGlass

Environment

Max
Delta-rs version: latest(deltalake = { git = "https://github.com/delta-io/delta-rs", branch = "main", features = ["s3", "datafusion"] })

Binding:

Environment: OsX

  • Cloud provider: AWS
  • OS: Mac
  • Other:

Bug

What happened:

I create a table with a "date" partition column,

SchemaField::new(
            "date".to_string(),
            SchemaDataType::primitive("date".to_string()),
            false,
            HashMap::new(),
        );
DeltaOps(table)
                .create()
                .with_columns(delta_schema)
                .with_partition_columns(vec!["date"])
                .await?

If I run any query that either selects date or filters by date, I get:

Error: External error: External error: Arrow error: External error: Arrow error: Invalid argument error: column types must match schema types, expected Dictionary(UInt16, Date32) but found Dictionary(UInt16, Null) at column index 1

Caused by:
    0: External error: Arrow error: External error: Arrow error: Invalid argument error: column types must match schema types, expected Dictionary(UInt16, Date32) but found Dictionary(UInt16, Null) at column index 1
    1: Arrow error: External error: Arrow error: Invalid argument error: column types must match schema types, expected Dictionary(UInt16, Date32) but found Dictionary(UInt16, Null) at column index 1
    2: External error: Arrow error: Invalid argument error: column types must match schema types, expected Dictionary(UInt16, Date32) but found Dictionary(UInt16, Null) at column index 1
    3: Arrow error: Invalid argument error: column types must match schema types, expected Dictionary(UInt16, Date32) but found Dictionary(UInt16, Null) at column index 1
    4: Invalid argument error: column types must match schema types, expected Dictionary(UInt16, Date32) but found Dictionary(UInt16, Null) at column index 1

Removing the partition from the table and querying no longer results in an error, but querying on the date field is not working as expected (any query on the field results in no data).

What you expected to happen:
I expect the queries to run and filter by date

How to reproduce it:
See above

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions