Note
Kailangan ng pahintulot para ma-access ang page na ito. Maaari mong subukang mag-sign in o magpalit ng mga direktoryo.
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang baguhin ang mga direktoryo.
Creates a string column for the file name of the current Spark task.
Syntax
from pyspark.sql import functions as sf
sf.input_file_name()
Returns
pyspark.sql.Column: file names.
Examples
Example 1: Get input file name
import os
from pyspark.sql import functions as sf
path = os.path.abspath(__file__)
df = spark.read.text(path)
df.select(sf.input_file_name()).first()
Row(input_file_name()='file:/...')