class_docstr: Serializes Arrow record batches as a stream.
class_docstr_tok: ["Serializes","Arrow","record","batches","as","a","stream","."]
code: def dump_stream(self, iterator, stream):
      import pyarrow as pa
  
      writer = None
      try:
          for batch in iterator:
              if writer is None:
                  writer = pa.RecordBatchStreamWriter(
                      stream, batch.schema
                  )
              writer.write_batch(batch)
      finally:
          if writer is not None:
              writer.close()
  
imports: from pyspark.errors import PySparkRuntimeError, PySparkTypeError, PySparkValueError
  from pyspark.loose_version import LooseVersion
  from pyspark.serializers import Serializer, read_int, write_int, UTF8Deserializer, CPickleSerializer
  from pyspark.sql.pandas.types import from_arrow_type, to_arrow_type, _create_converter_from_pandas, _create_converter_to_pandas
  from pyspark.sql.types import DataType, StringType, StructType, BinaryType, StructField, LongType, IntegerType
label_desc: Use image node_id 1 for calling the ArrowStreamSerializer obj's underlying member method code with example usage: obj.dump_stream(iterator, stream) without return types