You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "ozankabak (via GitHub)" <gi...@apache.org> on 2023/06/21 19:43:43 UTC

[GitHub] [arrow-datafusion] ozankabak commented on a diff in pull request #6566: Mismatch in MemTable of Select Into when projecting on aggregate window functions

ozankabak commented on code in PR #6566:
URL: https://github.com/apache/arrow-datafusion/pull/6566#discussion_r1237601207


##########
datafusion/sql/src/select.rs:
##########
@@ -194,7 +198,13 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
                 .iter()
                 .map(|expr| rebase_expr(expr, &window_func_exprs, &plan))
                 .collect::<Result<Vec<Expr>>>()?;
-
+            if select.into.is_some() {
+                for expr in select_exprs_post_aggr.iter_mut() {
+                    if let Expr::Column(_) = expr.clone() {
+                        *expr = expr.clone().alias(physical_name(expr)?);
+                    }
+                }
+            }

Review Comment:
   After exploring all options, I get the impression that this option that @alamb mentioned before:
   
   > Update `BoundedWindowAggExec` to produce the field names declared by the `WindowAggExec`
   
   is the most consistent path forward. It tends to produce overly verbose column names, but all the other options seems to suffer from some kind of a problem. AFAICT this approach is similar to what @berkaysynnada mentioned as [his first solution alternative in the issue description](https://github.com/apache/arrow-datafusion/issues/6492) as well.
   
   @alamb, @comphead: What do you think? Should we move forward with this approach?



-- 
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-unsubscribe@arrow.apache.org

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