Lordworms commented on issue #14958: URL: https://github.com/apache/datafusion/issues/14958#issuecomment-2700016967
I have done some basic research on how Postgres deal with table function with column, for example, something like this would work in Postgresql ``` SELECT t.id, t.start_value, t.end_value, g.num FROM table_a t, LATERAL generate_series(t.start_value, t.end_value) AS g(num); ``` So I think the first step is to implement support for LATERAL, I see some PR like https://github.com/apache/datafusion/pull/14595 to support basic LATERAL JOIN using decorrelation subqueries but I think we should also support some other LATERAL use cases like ``` > SELECT u.id, u.name, sub.age_plus_10 FROM users u, LATERAL (SELECT u.age + 10 AS age_plus_10) sub; This feature is not implemented: Physical plan does not support logical expression OuterReferenceColumn(Int32, Column { relation: Some(Bare { table: "u" }), name: "age" }) ``` After we have the support for Laterral, we can push any table scan down to table function scan or pull up the table function scan up to support input for Tablescan. I'll probably start with supporting basic Lateral. -- 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