Skip to content

Conversation

@weiting-chen
Copy link
Collaborator

Port facebookincubator#9868 for min/max agg func support

…ox/functions/prestosql/aggregates/MinMaxAggregates.cpp

Add min, max Spark aggregate functions (facebookincubator#9868)

Summary:
There are two semantic differences between Presto and Spark.
1. Nested NULLs are compared as values in Spark and as "unknown value" in
Presto.
2. The timestamp type represents a time instant in microsecond precision in
Spark, but millisecond precision in Presto.

Therefore, we need to implement min and max functions for Spark. In this PR,
1. Move Presto `min` and `max` aggregation function implements to lib folder.
2. Add `getMinFunctionFactory` and `getMaxFunctionFactory`  which allow callers
to register max & min functions with different behaviors.

Pull Request resolved: facebookincubator#9868

Reviewed By: mbasmanova

Differential Revision: D60051468

Pulled By: kevinwilfong

fbshipit-source-id: 1f056420d6909174a35d336e4e1b413a87ef7665
@weiting-chen weiting-chen changed the title [DNM][Branch-1.2] Port #9868 for min/max agg func support [Branch-1.2] Port #9868 for min/max agg func support Nov 13, 2024
@weiting-chen weiting-chen merged commit efd55fb into oap-project:branch-1.2 Nov 14, 2024
17 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants