Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2026 10:17 AM
You can get metadata information for input files with the _metadata column.For file path you would use _metadata.file_path.
df = spark.read \
.format("csv") \
.schema(schema) \
.load("dbfs:/tmp/*") \
.select("*", "_metadata.file_path")More details - https://docs.databricks.com/aws/en/ingestion/file-metadata-column
Thank You
Pradeep Singh - https://www.linkedin.com/in/dbxdev
Pradeep Singh - https://www.linkedin.com/in/dbxdev