pyarrow.flight.FlightStreamWriter#

class pyarrow.flight.FlightStreamWriter#

Bases: pyarrow._flight.MetadataRecordBatchWriter

A writer that also allows closing the write side of a stream.

__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

begin(self, Schema schema[, options])

Prepare to write data to this stream with the given schema.

close(self)

Close stream and write end-of-stream 0 marker.

done_writing(self)

Indicate that the client is done writing, but not done reading.

write(self, table_or_batch)

Write RecordBatch or Table to stream.

write_batch(self, RecordBatch batch)

Write RecordBatch to stream.

write_metadata(self, buf)

Write Flight metadata by itself.

write_table(self, Table table[, max_chunksize])

Write Table to stream in (contiguous) RecordBatch objects.

write_with_metadata(self, RecordBatch batch, buf)

Write a RecordBatch along with Flight metadata.

Attributes

stats

Current IPC write statistics.

begin(self, Schema schema: Schema, options=None)#

Prepare to write data to this stream with the given schema.

close(self)#

Close stream and write end-of-stream 0 marker.

done_writing(self)#

Indicate that the client is done writing, but not done reading.

stats#

Current IPC write statistics.

write(self, table_or_batch)#

Write RecordBatch or Table to stream.

Parameters
table_or_batch{RecordBatch, Table}
write_batch(self, RecordBatch batch)#

Write RecordBatch to stream.

Parameters
batchRecordBatch
write_metadata(self, buf)#

Write Flight metadata by itself.

write_table(self, Table table, max_chunksize=None, **kwargs)#

Write Table to stream in (contiguous) RecordBatch objects.

Parameters
tableTable
max_chunksizeint, default None

Maximum size for RecordBatch chunks. Individual chunks may be smaller depending on the chunk layout of individual columns.

write_with_metadata(self, RecordBatch batch, buf)#

Write a RecordBatch along with Flight metadata.

Parameters
batchRecordBatch

The next RecordBatch in the stream.

bufBuffer

Application-specific metadata for the batch as defined by Flight.