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.
Adds multiple input options for the underlying data source.
For available options, see DataStreamReader options.
Syntax
options(**options)
Parameters
| Parameter | Type | Description |
|---|---|---|
**options |
dict | Key-value pairs of options. |
Returns
DataStreamReader
Examples
spark.readStream.options(x="1", y=2)
# <...streaming.readwriter.DataStreamReader object ...>
Specify options as a dictionary:
spark.readStream.options(**{"k1": "v1", "k2": "v2"})
# <...streaming.readwriter.DataStreamReader object ...>
Generate 10 rows per second with 10 partitions using the Rate source:
import time
q = spark.readStream.format("rate").options(
rowsPerSecond=10, numPartitions=10
).load().writeStream.format("console").start()
time.sleep(3)
q.stop()