This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 06be63ffbe docs: Improve docs on AggregateFunctionExpr construction 
(#15044)
06be63ffbe is described below

commit 06be63ffbe1cce242aab43587af3a10ea28c7798
Author: Christian <[email protected]>
AuthorDate: Thu Mar 6 14:03:20 2025 +0100

    docs: Improve docs on AggregateFunctionExpr construction (#15044)
    
    * doc: link to AggregateFunctionBuilder from AggregateFunctionExpr
    
    * doc: Alias is required in Builder before construction
    
    * cargo fmt
    
    * minor: Improve error msg when AggregateExprBuilder::alias is missing
    
    * cargo fmt
---
 datafusion/physical-expr/src/aggregate.rs | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/datafusion/physical-expr/src/aggregate.rs 
b/datafusion/physical-expr/src/aggregate.rs
index 07a98340db..34c4e52d51 100644
--- a/datafusion/physical-expr/src/aggregate.rs
+++ b/datafusion/physical-expr/src/aggregate.rs
@@ -91,6 +91,9 @@ impl AggregateExprBuilder {
         }
     }
 
+    /// Constructs an `AggregateFunctionExpr` from the builder
+    ///
+    /// Note that an [`Self::alias`] must be provided before calling this 
method.
     pub fn build(self) -> Result<AggregateFunctionExpr> {
         let Self {
             fun,
@@ -132,7 +135,11 @@ impl AggregateExprBuilder {
         let data_type = fun.return_type(&input_exprs_types)?;
         let is_nullable = fun.is_nullable();
         let name = match alias {
-            None => return internal_err!("alias should be provided"),
+            None => {
+                return internal_err!(
+                    "AggregateExprBuilder::alias must be provided prior to 
calling build"
+                )
+            }
             Some(alias) => alias,
         };
 
@@ -199,6 +206,8 @@ impl AggregateExprBuilder {
 }
 
 /// Physical aggregate expression of a UDAF.
+///
+/// Instances are constructed via [`AggregateExprBuilder`].
 #[derive(Debug, Clone)]
 pub struct AggregateFunctionExpr {
     fun: AggregateUDF,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to