إشعار
يتطلب الوصول إلى هذه الصفحة تخويلاً. يمكنك محاولة تسجيل الدخول أو تغيير الدلائل.
يتطلب الوصول إلى هذه الصفحة تخويلاً. يمكنك محاولة تغيير الدلائل.
Adds input options for the underlying data source.
Syntax
options(**options)
Parameters
| Parameter | Type | Description |
|---|---|---|
**options |
dict | String keys mapped to primitive-type values. For available options, see DataFrameReader options. |
Returns
DataFrameReader
Examples
Read a CSV file with nullValue and header options set.
import tempfile
with tempfile.TemporaryDirectory(prefix="options") as d:
df = spark.createDataFrame([{"age": 100, "name": "Alice"}])
df.write.option("header", True).mode("overwrite").format("csv").save(d)
spark.read.options(
nullValue="Alice",
header=True
).format('csv').load(d).show()
# +---+----+
# |age|name|
# +---+----+
# |100|NULL|
# +---+----+