adriangb commented on issue #20135: URL: https://github.com/apache/datafusion/issues/20135#issuecomment-3841217634
> I think the first key decision is how to model this method / what is the API > > I think [@ethan-tyler](https://github.com/ethan-tyler) / [@adriangb](https://github.com/adriangb) were leaning towards some built in functions like > > select filename() from my_table > > And then rewriting the function reference in the datasource > > One potential downside of doing it this way is that it is not clear how it would work for a multi-table query -- for example > > SELECT ..., filename() -- <---- Which relation does `filename()` get attached to? > FROM a JOIN b USING (id) That's an interesting case. I think in general "which table did this row come from" is difficult to mix with joins. I'm guessing in systems where this is a special column this is not a problem: ```sql SELECT ..., a.filename FROM a JOIN b USING (id) ``` Maybe something like `filename(a.id)` (really just any reference to a column in either table) would force the expression to be pushed down into that side and disambiguate by establishing a dependence of the expressions on that table. And if you don't specify a table and the rows are from a join you get back `null`. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
