orc (DataFrameReader)
ORCファイルを読み込み、結果をDataFrameとして返します。
構文
orc(path, **options)
パラメーター
パラメーター | Type | 説明 |
|---|---|---|
| 文字列またはリスト | 1つ以上の入力パス。 |
戻り値
DataFrame
例
DataFrameをORCファイルに書き込み、それを読み込む。
Python
import tempfile
with tempfile.TemporaryDirectory(prefix="orc") as d:
spark.createDataFrame(
[{"age": 100, "name": "Alice"}]
).write.mode("overwrite").format("orc").save(d)
spark.read.orc(d).show()
# +---+------------+
# |age| name|
# +---+------------+
# |100|Alice|
# +---+------------+