メインコンテンツまでスキップ

入力ファイルブロック長

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

構文

Python
from pyspark.sql import functions as sf

sf.input_file_block_length()

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

Python
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()
Output
+-------------------------+
|input_file_block_length()|
+-------------------------+
| 87|
| 87|
| 87|
| 87|
| 87|
| 87|
| 87|
| 87|
+-------------------------+