input_file_name function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

Returns the name of the file being read, or empty string if not available.

This function is not available on Unity Catalog.

In Databricks SQL and Databricks Runtime 13.1 and above this function is deprecated. Please use _metadata.file_name.

Syntax

input_file_name()

Arguments

This function takes no arguments.

Returns

A STRING.

If the information is not available an empty string is returned.

The function is non-deterministic.

Examples

> SELECT input_file_name();