yyy1000 commented on issue #10664: URL: https://github.com/apache/datafusion/issues/10664#issuecomment-2136478200
I tried to implement for a while and I have a question, for selecting a window function, there would be an projection. ``` > explain SELECT first_value(y) OVER (ORDER BY x) FROM foo; | logical_plan | Projection: FIRST_VALUE(foo.y) ORDER BY [foo.x ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW | | | WindowAggr: windowExpr=[[FIRST_VALUE(foo.y) ORDER BY [foo.x ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW]] | | | TableScan: foo projection=[x, y] | ``` However, for an aggregate, there's not. ``` > explain select count(x) from foo; +---------------+------------------------------------------------+ | plan_type | plan | +---------------+------------------------------------------------+ | logical_plan | Aggregate: groupBy=[[]], aggr=[[COUNT(foo.x)]] | | | TableScan: foo projection=[x] | +---------------+------------------------------------------------+ ``` In my understanding, window function is a special case of aggregate function, why would these two have different plan struct? -- 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