Nóta
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað aðskrá þig inn eða breyta skráasöfnum.
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað að breyta skráasöfnum.
Adds an output option for the underlying data source.
For available options, see DataStreamWriter options.
Syntax
option(key, value)
Parameters
| Parameter | Type | Description |
|---|---|---|
key |
str | The option key. |
value |
str, int, float, or bool | The option value. |
Returns
DataStreamWriter
Examples
df = spark.readStream.format("rate").load()
df.writeStream.option("x", 1)
# <...streaming.readwriter.DataStreamWriter object ...>
Print 3 rows per batch to the console:
import time
q = spark.readStream.format(
"rate").option("rowsPerSecond", 10).load().writeStream.format(
"console").option("numRows", 3).start()
time.sleep(3)
q.stop()