You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/23 20:57:47 UTC

[GitHub] [arrow-datafusion] Dandandan commented on a change in pull request #375: add window expression stream, delegated window aggregation, and a basic structure for row_number

Dandandan commented on a change in pull request #375:
URL: https://github.com/apache/arrow-datafusion/pull/375#discussion_r637600299



##########
File path: datafusion/src/physical_plan/windows.rs
##########
@@ -57,25 +74,81 @@ pub fn create_window_expr(
                 name,
             )?,
         })),
-        WindowFunction::BuiltInWindowFunction(fun) => {
-            Err(DataFusionError::NotImplemented(format!(
-                "window function with {:?} not implemented",
-                fun
-            )))
-        }
+        WindowFunction::BuiltInWindowFunction(fun) => Ok(Arc::new(BuiltInWindowExpr {
+            window: create_built_in_window_expr(fun, args, input_schema, name)?,
+        })),
+    }
+}
+
+fn create_built_in_window_expr(
+    fun: &BuiltInWindowFunction,
+    _args: &[Arc<dyn PhysicalExpr>],
+    _input_schema: &Schema,
+    name: String,
+) -> Result<Arc<dyn BuiltInWindowFunctionExpr>> {
+    match fun {
+        BuiltInWindowFunction::RowNumber => Ok(Arc::new(RowNumber::new(name))),
+        _ => Err(DataFusionError::NotImplemented(format!(
+            "window function with {:?} not yet implemented",

Review comment:
       ```suggestion
               "Window function with {:?} not yet implemented",
   ```




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org