Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
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:/...')