Skip to content

Add input_file_name built-in function #6051

@nkarpov

Description

@nkarpov

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions