Skip to content

[Story][FEA] Timeseries-oriented cuDF-Polars: OrderScheme metadata, strict sort boundaries, and sort-aware execution #22128

Description

@rjzamora

Context

Streaming window and time-oriented operators are tracked in #22032 — Streaming window support in cuDF-Polars (rolling, group_by_dynamic, ordered over(), shift, etc.). In practice these features almost always sit in sort-based workflows (by time or logical sequence).

Today, even when data is already sorted on disk, the executor will typically need to destroy that ordering to perform common group_by and join operations. Even when we do apply global sort operations, we don't keep track of this behavior in the executor, and will sometimes re-sort or shuffle data unnecessarily. Making ordering a first-class ChannelMetadata property (similar in spirit to how hash partitioning metadata is already tracked and preserved) should make the workloads highlighted in #22032 materially cheaper (less shuffle, less memory, simpler plans).

Dependency / alignment: rapidsmpf#853 — Add OrderScheme partitioning metadata (ordering in ChannelMetadata / partitioning). [DONE]

Sequencing



  • Add general utility to enforce a local and global partitioning specification: We introduce enforce_partitioning that will abstracts-away the process of aligning incoming data with a specific Partitioning specification (whether that specification comprises HashScheme, OrderScheme, or a combination of these. Prerequisites:
  • Use enforce_partitioning to avoid unnecessary shuffling:
    • Use enforce_partitioning in groupby_actor
    • Use enforce_partitioning in join_actor
    • Use enforce_partitioning in over_actor
  • Implement MergeSorted: This feature will depend on enforce_partitioning to align the partitioning of the input tables.

  • Implement MapFunction(“hint_sorted”) (i.e. set_sorted()): This API allows the user to inform Polars that a table is already sorted. This means the user may pre-shuffle their dataset(s) on specific keys, and use set_sorted to declare that we don't need to re-sort on these keys. Prerequisites:

Metadata

Metadata

Assignees

No one assigned

    Labels

    cudf-polarsIssues specific to cudf-polarsfeature requestNew feature or request

    Type

    No type

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions