-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
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>).