Σημείωμα
Η πρόσβαση σε αυτήν τη σελίδα απαιτεί εξουσιοδότηση. Μπορείτε να δοκιμάσετε να εισέλθετε ή να αλλάξετε καταλόγους.
Η πρόσβαση σε αυτήν τη σελίδα απαιτεί εξουσιοδότηση. Μπορείτε να δοκιμάσετε να αλλάξετε καταλόγους.
Adds an input option for the underlying data source.
For available options, see DataStreamReader options.
Syntax
option(key, value)
Parameters
| Parameter | Type | Description |
|---|---|---|
key |
str | The option key. |
value |
str, int, float, or bool | The option value. |
Returns
DataStreamReader
Examples
spark.readStream.option("x", 1)
# <...streaming.readwriter.DataStreamReader object ...>
Generate 10 rows per second using the Rate source:
import time
q = spark.readStream.format(
"rate").option("rowsPerSecond", 10).load().writeStream.format("console").start()
time.sleep(3)
q.stop()