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

Excel (DataStreamReader)

Excelファイルをストリーム的にロードし、結果をDataFrameとして返します。

構文

excel(path, **options)

パラメーター

パラメーター

Type

説明

path

str

Excelデータセットへのパス。

戻り値

DataFrame

一時的なExcelファイルからストリームを読み込む:

Python
import tempfile
import time
with tempfile.TemporaryDirectory(prefix="excel") as d:
spark.range(10).write.mode("overwrite").excel(d)
q = spark.readStream.schema("id LONG").excel(d).writeStream.format("console").start()
time.sleep(3)
q.stop()
このページの見出し