Skip to content

[PIPELINES] Support partition transforms in SDP partition_cols #57908

Description

@wilhelmagren

spark=4.1.3
iceberg=1.11.0

Problem

SDP currently treats every entry in partition_cols as an identity partition transform.

for example

@dp.materialized_view(partition_cols=["months(event_time)"])
def events():
    ...

causes months(event_time) to be interpreted as a column name instead of a partition transform.

Behaviour comes from DatasetManager.materializeTable where all partition cols are converted using identity

table.partitionCols.toSeq.flatten.map(Expressions.identity)

and as a result using the above partition col it just becomes identity('months(event_time)').

Expected behaviour

SDP should support the same partition transforms that Spark SQL already supports

Bare col-names (partition_col=["event_date"]) should continue producing identity(event_date)
but partition transforms should be respected, and combining partitions like

partition_cols=["country", "bucket(16, user_id)"]

should produce its corresponding V2 partition transforms.

Existing SQL support

Catalyst parses partition transform syntax for SQL PARTITIONED BY and creates corresponding V2 Transform

SDP should just reuse the existing Catalyst parsing logic and not short-circuit everything to identity transform.

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