class_docstr: Interface used to write a streaming :class:`DataFrame <pyspark.sql.DataFrame>` to external
  storage systems (e.g. file systems, key-value stores, etc).
  Use :attr:`DataFrame.writeStream <pyspark.sql.DataFrame.writeStream>`
  to access this.
  
  .. versionadded:: 2.0.0
  
  .. versionchanged:: 3.5.0
      Supports Spark Connect.
  
  Notes
  -----
  This API is evolving.
  
  Examples
  --------
  The example below uses Rate source that generates rows continuously.
  After that, we operate a modulo by 3, and then writes the stream out to the console.
  The streaming query stops in 3 seconds.
  
  >>> import time
  >>> df = spark.readStream.format("rate").load()
  >>> df = df.selectExpr("value % 3 as v")
  >>> q = df.writeStream.format("console").start()
  >>> time.sleep(3)
  >>> q.stop()
class_docstr_tok: ["Interface","used","to","write","a","streaming",":","class",":","`","DataFrame","<","pyspark.sql.DataFrame",">","`","to","external","storage","systems","(","e.g",".","file","systems",",","key-value","stores",",","etc",")",".","Use",":","attr",":","`","DataFrame.writeStream","<","pyspark.sql.DataFrame.writeStream",">","`","to","access","this",".","..","versionadded",":",":","2.0.0","..","versionchanged",":",":","3.5.0","Supports","Spark","Connect",".","Notes","--","--","-","This","API","is","evolving",".","Examples","--","--","--","--","The","example","below","uses","Rate","source","that","generates","rows","continuously",".","After","that",",","we","operate","a","modulo","by","3",",","and","then","writes","the","stream","out","to","the","console",".","The","streaming","query","stops","in","3","seconds",".",">",">",">","import","time",">",">",">","df","=","spark.readStream.format","(","``","rate","''",")",".load","(",")",">",">",">","df","=","df.selectExpr","(","``","value","%","3","as","v","''",")",">",">",">","q","=","df.writeStream.format","(","``","console","''",")",".start","(",")",">",">",">","time.sleep","(","3",")",">",">",">","q.stop","(",")"]
docstr: Specifies the underlying output data source.
  
  .. versionadded:: 2.0.0
  
  .. versionchanged:: 3.5.0
      Supports Spark Connect.
  
  Parameters
  ----------
  source : str
      string, name of the data source, which for now can be 'parquet'.
  
  Notes
  -----
  This API is evolving.
  
  Examples
  --------
  >>> df = spark.readStream.format("rate").load()
  >>> df.writeStream.format("text")
  <...streaming.readwriter.DataStreamWriter object ...>
  
  This API allows to configure the source to write. The example below writes a CSV
  file from Rate source in a streaming manner.
  
  >>> import tempfile
  >>> import time
  >>> with tempfile.TemporaryDirectory() as d, tempfile.TemporaryDirectory() as cp:
  ...     df = spark.readStream.format("rate").load()
  ...     q = df.writeStream.format("csv").option("checkpointLocation", cp).start(d)
  ...     time.sleep(5)
  ...     q.stop()
  ...     spark.read.schema("timestamp TIMESTAMP, value STRING").csv(d).show()
  +...---------+-----+
  |...timestamp|value|
  +...---------+-----+
  ...
docstr_tok: ["Specifies","the","underlying","output","data","source",".","..","versionadded",":",":","2.0.0","..","versionchanged",":",":","3.5.0","Supports","Spark","Connect",".","Parameters","--","--","--","--","--","source",":","str","string",",","name","of","the","data","source",",","which","for","now","can","be","'parquet","'",".","Notes","--","--","-","This","API","is","evolving",".","Examples","--","--","--","--",">",">",">","df","=","spark.readStream.format","(","``","rate","''",")",".load","(",")",">",">",">","df.writeStream.format","(","``","text","''",")","<","...","streaming.readwriter.DataStreamWriter","object","...",">","This","API","allows","to","configure","the","source","to","write",".","The","example","below","writes","a","CSV","file","from","Rate","source","in","a","streaming","manner",".",">",">",">","import","tempfile",">",">",">","import","time",">",">",">","with","tempfile.TemporaryDirectory","(",")","as","d",",","tempfile.TemporaryDirectory","(",")","as","cp",":","...","df","=","spark.readStream.format","(","``","rate","''",")",".load","(",")","...","q","=","df.writeStream.format","(","``","csv","''",")",".option","(","``","checkpointLocation","''",",","cp",")",".start","(","d",")","...","time.sleep","(","5",")","...","q.stop","(",")","...","spark.read.schema","(","``","timestamp","TIMESTAMP",",","value","STRING","''",")",".csv","(","d",")",".show","(",")","+","...","--","--","--","--","-+","--","--","-+","|","...","timestamp|value|","+","...","--","--","--","--","-+","--","--","-+","..."]
code: def format(self, source: str) -> "DataStreamWriter":
      """Specifies the underlying output data source.
  
      .. versionadded:: 2.0.0
  
      .. versionchanged:: 3.5.0
          Supports Spark Connect.
  
      Parameters
      ----------
      source : str
          string, name of the data source, which for now can be 'parquet'.
  
      Notes
      -----
      This API is evolving.
  
      Examples
      --------
      >>> df = spark.readStream.format("rate").load()
      >>> df.writeStream.format("text")
      <...streaming.readwriter.DataStreamWriter object ...>
  
      This API allows to configure the source to write. The example below writes a CSV
      file from Rate source in a streaming manner.
  
      >>> import tempfile
      >>> import time
      >>> with tempfile.TemporaryDirectory() as d, tempfile.TemporaryDirectory() as cp:
      ...     df = spark.readStream.format("rate").load()
      ...     q = df.writeStream.format("csv").option("checkpointLocation", cp).start(d)
      ...     time.sleep(5)
      ...     q.stop()
      ...     spark.read.schema("timestamp TIMESTAMP, value STRING").csv(d).show()
      +...---------+-----+
      |...timestamp|value|
      +...---------+-----+
      ...
      """
      self._jwrite = self._jwrite.format(source)
      return self
  
imports: import sys
  from collections.abc import Iterator
  from typing import cast, overload, Any, Callable, List, Optional, TYPE_CHECKING, Union
  from py4j.java_gateway import java_import, JavaObject
  from pyspark.sql.column import _to_seq
  from pyspark.sql.readwriter import OptionUtils, to_str
  from pyspark.sql.streaming.query import StreamingQuery
  from pyspark.sql.types import Row, StructType
  from pyspark.sql.utils import ForeachBatchFunction
  from pyspark.errors import PySparkTypeError, PySparkValueError, PySparkAttributeError, PySparkRuntimeError
label_desc: Use image node_id 4 for calling the DataStreamWriter obj's underlying member method code with example usage: obj.format(source) and returns: self