Skip to content

Support date types in percentile_cont aggregate function #18601

Description

@2010YOUY01

Is your feature request related to a problem or challenge?

#17988 has added support for percentile_cont, and this function can support more date-related data types.

Data is generated with https://github.com/clflushopt/tpchgen-rs/tree/main/tpchgen-cli

DataFusion CLI v51.0.0
> select percentile_cont(0.01) within group (order by l_shipdate)
from '/Users/yongting/data/tpch_sf1/lineitem.parquet';
Error during planning: Failed to coerce arguments to satisfy a call to 'percentile_cont' function: coercion from Date32, Float64 to the signature OneOf([Exact([Int8, Float64]), Exact([Int16, Float64]), Exact([Int32, Float64]), Exact([Int64, Float64]), Exact([UInt8, Float64]), Exact([UInt16, Float64]), Exact([UInt32, Float64]), Exact([UInt64, Float64]), Exact([Float32, Float64]), Exact([Float64, Float64])]) failed No function matches the given name and argument types 'percentile_cont(Date32, Float64)'. You might need to add explicit type casts.
        Candidate functions:
        percentile_cont(expr: Int8, percentile: Float64)
        percentile_cont(expr: Int16, percentile: Float64)
        percentile_cont(expr: Int32, percentile: Float64)
        percentile_cont(expr: Int64, percentile: Float64)
        percentile_cont(expr: UInt8, percentile: Float64)
        percentile_cont(expr: UInt16, percentile: Float64)
        percentile_cont(expr: UInt32, percentile: Float64)
        percentile_cont(expr: UInt64, percentile: Float64)
        percentile_cont(expr: Float32, percentile: Float64)
        percentile_cont(expr: Float64, percentile: Float64)

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. 2010YOUY01 commented on Nov 16, 2025

    @2010YOUY01
    MemberAuthor

    @T2MIX Thank you. I suggest to start after #18663 is merged, there seem to be conflicts.

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions