Skip to content

Decouple query rewrite from Materialized trait #92

@suremarc

Description

@suremarc

The Materialized trait assumes tables are logically partitioned and sit in object storage. See the current definition:

pub trait Materialized: ListingTableLike {
    // Required method
    fn query(&self) -> LogicalPlan;

    // Provided methods
    fn config(&self) -> MaterializedConfig { ... }
    fn static_partition_columns(&self) -> Vec<String> { ... }
}

However, the query rewrite implementation is useful for materialized views that don't necessarily follow this storage model (particularly those with real-time storage engines)

We should probably rename the existing trait to something like MaterializedListingTableLike, and make a new Materialized trait which the former is an extension of. Query rewrite can just use the Materialized trait. We'd then have something like this:

pub trait Materialized: TableProvider + 'static {
    // Required method
    fn query(&self) -> LogicalPlan;

    // Provided methods
    fn config(&self) -> MaterializedConfig { ... }
}

pub trait MaterializedListingTableLike: Materialized + ListingTableLike {
    // Provided methods
    fn static_partition_columns(&self) -> Vec<String> { ... }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions