From fd3a9432c56923c7085cf2efa621549dc3c006f9 Mon Sep 17 00:00:00 2001 From: Mohammad Linjawi Date: Mon, 2 Mar 2026 20:31:27 +0300 Subject: [PATCH] Map approx_count_distinct_for_intervals --- docs/velox-backend-aggregate-function-support.md | 4 ++-- .../org/apache/gluten/expression/ExpressionMappings.scala | 1 + .../scala/org/apache/gluten/expression/ExpressionNames.scala | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/velox-backend-aggregate-function-support.md b/docs/velox-backend-aggregate-function-support.md index 7c518530b191..59ed51b9a859 100644 --- a/docs/velox-backend-aggregate-function-support.md +++ b/docs/velox-backend-aggregate-function-support.md @@ -1,6 +1,6 @@ # Aggregate Functions Support Status -**Out of 62 aggregate functions in Spark 3.5, Gluten currently fully supports 52 functions and partially supports 1 function.** +**Out of 62 aggregate functions in Spark 3.5, Gluten currently fully supports 53 functions and partially supports 1 function.** ## Aggregate Functions @@ -9,6 +9,7 @@ | any | BoolOr | S | | | any_value | AnyValue | S | | | approx_count_distinct | HyperLogLogPlusPlus | S | | +| approx_count_distinct_for_intervals | ApproxCountDistinctForIntervals | S | endpoints and relativeSD must be constant; endpoints can be numeric/date/timestamp/interval/decimal and don't need to match input | | approx_percentile | ApproximatePercentile | | | | array_agg | CollectList | S | | | avg | Average | S | | @@ -68,4 +69,3 @@ | var_pop | VariancePop | S | | | var_samp | VarianceSamp | S | | | variance | VarianceSamp | S | | - diff --git a/gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala b/gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala index b13aced2a62c..8c25576641e1 100644 --- a/gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala +++ b/gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala @@ -327,6 +327,7 @@ object ExpressionMappings { Sig[Kurtosis](KURTOSIS), Sig[ApproximatePercentile](APPROX_PERCENTILE), Sig[HyperLogLogPlusPlus](APPROX_COUNT_DISTINCT), + Sig[ApproxCountDistinctForIntervals](APPROX_COUNT_DISTINCT_FOR_INTERVALS), Sig[Percentile](PERCENTILE) ) ++ SparkShimLoader.getSparkShims.aggregateExpressionMappings diff --git a/shims/common/src/main/scala/org/apache/gluten/expression/ExpressionNames.scala b/shims/common/src/main/scala/org/apache/gluten/expression/ExpressionNames.scala index f2ae5647b141..c6f452323b45 100644 --- a/shims/common/src/main/scala/org/apache/gluten/expression/ExpressionNames.scala +++ b/shims/common/src/main/scala/org/apache/gluten/expression/ExpressionNames.scala @@ -48,6 +48,7 @@ object ExpressionNames { final val APPROX_DISTINCT = "approx_distinct" final val APPROX_PERCENTILE = "approx_percentile" final val APPROX_COUNT_DISTINCT = "approx_count_distinct" + final val APPROX_COUNT_DISTINCT_FOR_INTERVALS = "approx_count_distinct_for_intervals" final val PERCENTILE = "percentile" final val SKEWNESS = "skewness" final val KURTOSIS = "kurtosis"