नोट
इस पेज तक पहुँच के लिए प्रमाणन की आवश्यकता होती है. आप साइन इन करने या निर्देशिकाओं को बदलने का प्रयास कर सकते हैं.
इस पेज तक पहुँच के लिए प्रमाणन की आवश्यकता होती है. आप निर्देशिकाओं को बदलने का प्रयास कर सकते हैं.
Defines a streaming DataFrame on a table. The data source corresponding to the table must support streaming mode.
Syntax
table(tableName)
Parameters
| Parameter | Type | Description |
|---|---|---|
tableName |
str | Name of the table. |
Returns
DataFrame
Examples
Load a data stream from a table:
import tempfile
import time
_ = spark.sql("DROP TABLE IF EXISTS my_table")
with tempfile.TemporaryDirectory(prefix="table") as d:
q1 = spark.readStream.format("rate").load().writeStream.toTable(
"my_table", checkpointLocation=d)
q2 = spark.readStream.table("my_table").writeStream.format("console").start()
time.sleep(3)
q1.stop()
q2.stop()
_ = spark.sql("DROP TABLE my_table")