Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
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|
# +---+------------+