Skip to content

Add support for maps with decimal values in map_union_sum #26659

@pramodsatya

Description

@pramodsatya

map_union_sum aggregate function does not support maps where value is of decimal type. The type variable constraint, nonDecimalNumericTypeParameter, is used to enforce this and this constraint is used only in map_union_sum.
It is not clear why this restriction was added to map_union_sum in the first place, but following the discussion from facebookincubator/velox#14049, the map_union_sum function should support maps with decimal values. The constraint nonDecimalNumericTypeParameter can be modified to numericTypeParameter.

Context

Presto C++ clusters with sidecar supports function signature map_union_sum(MAP<K, Decimal>) by coercing it to map_union_sum(MAP<K, Real>). The constraint nonDecimalNumericTypeParameter is not present in Velox in order to enforce this restriction.
Instead of adding this constraint in Velox, as proposed in facebookincubator/velox#14049, the map_union_sum function in Presto should be fixed. As a follow-up, map_union_sum Presto function in Velox should support function signature map_union_sum(MAP<K, Decimal>).

cc: @tdcmeehan @aditi-pandit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions