次の方法で共有


input_file_block_length

読み取るブロックの長さを返します。使用できない場合は -1 します。

構文

from pyspark.sql import functions as sf

sf.input_file_block_length()

例示

例 1: 入力ファイルのブロック長を取得する

from pyspark.sql import functions as sf
df = spark.read.text("python/test_support/sql/ages_newlines.csv", lineSep=",")
df.select(sf.input_file_block_length()).show()
+-------------------------+
|input_file_block_length()|
+-------------------------+
|                       87|
|                       87|
|                       87|
|                       87|
|                       87|
|                       87|
|                       87|
|                       87|
+-------------------------+