diff --git a/sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala b/sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala index a4ff09596ad8e..0f08e10c00d22 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala @@ -73,7 +73,11 @@ class UDFRegistration private[sql] (functionRegistry: FunctionRegistry) extends * @return the registered UDAF. * * @since 1.5.0 + * @deprecated this method and the use of UserDefinedAggregateFunction are deprecated. + * Aggregator[IN, BUF, OUT] should now be registered as a UDF via the functions.udaf(agg) method. */ + @deprecated("Aggregator[IN, BUF, OUT] should now be registered as a UDF" + + " via the functions.udaf(agg) method.", "3.0.0") def register(name: String, udaf: UserDefinedAggregateFunction): UserDefinedAggregateFunction = { def builder(children: Seq[Expression]) = ScalaUDAF(children, udaf) functionRegistry.createOrReplaceTempFunction(name, builder) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/expressions/udaf.scala b/sql/core/src/main/scala/org/apache/spark/sql/expressions/udaf.scala index 4e8cb3a6ddd66..8407b1419af62 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/expressions/udaf.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/expressions/udaf.scala @@ -27,8 +27,12 @@ import org.apache.spark.sql.types._ * The base class for implementing user-defined aggregate functions (UDAF). * * @since 1.5.0 + * @deprecated UserDefinedAggregateFunction is deprecated. + * Aggregator[IN, BUF, OUT] should now be registered as a UDF via the functions.udaf(agg) method. */ @Stable +@deprecated("Aggregator[IN, BUF, OUT] should now be registered as a UDF" + + " via the functions.udaf(agg) method.", "3.0.0") abstract class UserDefinedAggregateFunction extends Serializable { /**