yyy1000 commented on code in PR #10767: URL: https://github.com/apache/datafusion/pull/10767#discussion_r1623523993
########## datafusion/sql/src/unparser/utils.rs: ########## @@ -82,3 +91,28 @@ pub(crate) fn unproject_agg_exprs(expr: &Expr, agg: &Aggregate) -> Result<Expr> }) .map(|e| e.data) } + +/// Recursively identify all Column expressions and transform them into the appropriate +/// window expression contained in window. +/// +/// For example, if expr contains the column expr "COUNT(*) PARTITION BY id" it will be transformed +/// into an actual window expression as identified in the window node. +pub(crate) fn unproject_window_exprs(expr: &Expr, window: &Window) -> Result<Expr> { Review Comment: I tried to implement `unproject_window_exprs` before by using the same method in `unproject_agg_exprs`, that's finding the `index_of_column` but it's not correct. Could you tell me why there's a difference? 😊 -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org