Skip to content

Consider removing functions_aggregate_decimal_output (decimal-output count) #1121

Description

@nielspardon

Problem

functions_aggregate_decimal_output.yaml defines count, count (star), and approx_count_distinct returning decimal<38, 0> instead of the standard i64. These share their names with the standard aggregates in functions_aggregate_generic.yaml, differing only in return type.

Same-named functions living in two extensions force every consumer to disambiguate count at resolution time (which extension? which return type?), and a name-based lookup can silently pick the "wrong" count. The value added over the standard i64 count is only the output type, which the caller can obtain with a cast.

Proposal

Consider removing functions_aggregate_decimal_output.yaml (or at least the count variants). Users who want a decimal-typed count would apply an explicit cast to the standard i64 result:

cast(count(x) AS decimal<38, 0>)

This removes the name collision and keeps a single, unambiguous count.

Context

Encountered while building the function namespace for substrait-python: count appears in both functions_aggregate_generic and functions_aggregate_decimal_output, requiring collision-preference logic to keep the default count returning i64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions