class_docstr: A base class for data source writers. Data source writers are responsible for saving
  the data to the data source.
  
  .. versionadded: 4.0.0
docstr: Writes data into the data source.
  
  This method is called once on each executor to write data to the data source.
  It accepts an iterator of input data and returns a single row representing a
  commit message, or None if there is no commit message.
  
  The driver collects commit messages, if any, from all executors and passes them
  to the ``commit`` method if all tasks run successfully. If any task fails, the
  ``abort`` method will be called with the collected commit messages.
  
  Parameters
  ----------
  iterator : Iterator[Row]
      An iterator of input data.
  
  Returns
  -------
  WriterCommitMessage : a serializable commit message
code: def write(self, iterator: Iterator[Row]) -> "WriterCommitMessage":
      """
      Writes data into the data source.
  
      This method is called once on each executor to write data to the data source.
      It accepts an iterator of input data and returns a single row representing a
      commit message, or None if there is no commit message.
  
      The driver collects commit messages, if any, from all executors and passes them
      to the ``commit`` method if all tasks run successfully. If any task fails, the
      ``abort`` method will be called with the collected commit messages.
  
      Parameters
      ----------
      iterator : Iterator[Row]
          An iterator of input data.
  
      Returns
      -------
      WriterCommitMessage : a serializable commit message
      """
      ...
  
imports: from abc import ABC, abstractmethod
  from collections import UserDict
  from typing import Any, Dict, Iterator, List, Sequence, Tuple, Type, Union, TYPE_CHECKING
  from pyspark.sql import Row
  from pyspark.sql.types import StructType
  from pyspark.errors import PySparkNotImplementedError
label_desc: Use image node_id 1 for calling the DataSourceWriter obj's underlying member method code with example usage: obj.write(iterator) without return types