-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add input_file_name built-in function #6051
Comments
I am interested in implementing this as requested by discussion#7979, just checked the the previous PRs, and here are my thoughts:
Friendly ping @alamb and @jorgecarleitao since you guys were the reviewer of the previous PR, I would like to hear your thoughts! :) And, haven't made any serious contributions to DataFusion, guidance would be hightly appreciated! |
I do not know. However, the use case of " that returns a string of the file from which the row was originally scanned" suggests it would be The spark docs say
I am not sure how that maps to what file is processed (aka does the same task process multiple input files?) As for implementation, perhaps it would be possible to model how partition columns are injected, though as you will find that is non trivial to implement. |
My "gut feeling" is that this will be a very complicated feature to implement with the existing Listing table provider. |
Is your feature request related to a problem or challenge?
It's useful to project the source input file of a data row to support file aware operations, for example for storage frameworks (delta-io/delta-rs#850). This is a built-in function in Spark, for example, https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.input_file_name.html
There was prior work before the repository split but it looks to have lost momentum:
apache/arrow#9944
apache/arrow#9976
apache/arrow#18601
Based on the conversations in the prior PRs and issues it looks like there was consensus that this feature should live in datafusion as opposed to arrow, so creating an issue here.
Describe the solution you'd like
A built-in function supported for both SQL and DataFrame APIs
input_file_name()
that returns a string of the file from which the row was originally scanned.Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: