MichaelScofield commented on code in PR #4553:
URL: https://github.com/apache/arrow-datafusion/pull/4553#discussion_r1045378402


##########
datafusion/expr/src/window_function.rs:
##########
@@ -35,24 +36,18 @@ pub enum WindowFunction {
     AggregateFunction(AggregateFunction),
     /// window function that leverages a built-in window function
     BuiltInWindowFunction(BuiltInWindowFunction),
+    AggregateUDF(Arc<AggregateUDF>),
 }
 
-impl FromStr for WindowFunction {
-    type Err = DataFusionError;
-    fn from_str(name: &str) -> Result<WindowFunction> {
-        let name = name.to_lowercase();
-        if let Ok(aggregate) = AggregateFunction::from_str(name.as_str()) {
-            Ok(WindowFunction::AggregateFunction(aggregate))
-        } else if let Ok(built_in_function) =
-            BuiltInWindowFunction::from_str(name.as_str())
-        {
-            Ok(WindowFunction::BuiltInWindowFunction(built_in_function))
-        } else {
-            Err(DataFusionError::Plan(format!(
-                "There is no window function named {}",
-                name
-            )))
-        }
+/// Find DataFusion's built-in window function by name.
+pub fn find_df_window_func(name: &str) -> Option<WindowFunction> {

Review Comment:
   It's the "df"(short for "DataFusion") in the name of `find_df_window_func` 
that clarify we are trying to find some built-in function.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to