Nota
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba mendaftar masuk atau menukar direktori.
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba menukar direktori.
Loads ORC files and returns the result as a DataFrame.
Syntax
orc(path, **options)
Parameters
| Parameter | Type | Description |
|---|---|---|
path |
str or list | One or more input paths. |
Returns
DataFrame
Examples
Write a DataFrame into an ORC file and read it back.
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|
# +---+------------+