dau_driver.stream_codec¶
Attributes¶
Classes¶
One fixed-width, null-free input column for record-batch encoding. |
|
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Contents¶
- dau_driver.stream_codec._ALIGNMENT_BYTES = 64¶
- dau_driver.stream_codec._SCALAR_RESULT_STRUCTS¶
- dau_driver.stream_codec._STRUCT_CODES¶
- dau_driver.stream_codec._ARROW_TYPE_FACTORIES¶
- class dau_driver.stream_codec.DecodedStreamColumn[source]¶
- header: dau_core.stream.BatchHeader¶
- column: dau_core.stream.ColumnDescriptor¶
- payload: bytes¶
- operations: tuple[dau_core.stream.OperationDescriptor, ...] = ()¶
- class dau_driver.stream_codec.DecodedStreamResult[source]¶
- header: dau_core.stream.BatchHeader¶
- column: dau_core.stream.ColumnDescriptor¶
- payload: bytes¶
- value: int | float¶
- class dau_driver.stream_codec.RecordBatchColumn[source]¶
One fixed-width, null-free input column for record-batch encoding.
- field_id: int¶
- logical_type: dau_core.stream.LogicalType¶
- payload: bytes¶
- class dau_driver.stream_codec.DecodedRecordBatch[source]¶
- header: dau_core.stream.BatchHeader¶
- columns: tuple[dau_core.stream.ColumnDescriptor, ...]¶
- payloads: tuple[bytes, ...]¶
- operations: tuple[dau_core.stream.OperationDescriptor, ...] = ()¶
- class dau_driver.stream_codec.StreamEncoder[source]¶
- static encode_column(logical_type: dau_core.stream.LogicalType, payload: bytes, *, row_count: int, field_id: int = 0, schema_hash: int = 0, batch_id: int = 0, operations: collections.abc.Iterable[dau_core.stream.OperationDescriptor] = ()) bytes[source]¶
- static encode_record_batch(columns: collections.abc.Sequence[RecordBatchColumn], *, row_count: int, schema_hash: int = 0, batch_id: int = 0, operations: collections.abc.Iterable[dau_core.stream.OperationDescriptor] = (), limits: dau_core.stream.RecordBatchLimits = DEFAULT_RECORD_BATCH_LIMITS) bytes[source]¶
Encode N fixed-width, null-free columns as one multi-column batch.
- static encode_arrow_batch(batch, *, schema_hash: int = 0, batch_id: int = 0, operations: collections.abc.Iterable[dau_core.stream.OperationDescriptor] = (), limits: dau_core.stream.RecordBatchLimits = DEFAULT_RECORD_BATCH_LIMITS) bytes[source]¶
Encode a PyArrow
RecordBatch/Tableof fixed-width, null-free columns.
- class dau_driver.stream_codec.StreamDecoder[source]¶
- static decode_column(data: bytes) DecodedStreamColumn[source]¶
- static decode_record_batch(data: bytes, *, limits: dau_core.stream.RecordBatchLimits = DEFAULT_RECORD_BATCH_LIMITS) DecodedRecordBatch[source]¶
Decode a multi-column record batch (the N-column counterpart of decode_column).
- static decode_record_batch_to_arrow(data: bytes, *, names: collections.abc.Sequence[str] | None = None, limits: dau_core.stream.RecordBatchLimits = DEFAULT_RECORD_BATCH_LIMITS)[source]¶
Decode and rematerialize as a PyArrow
RecordBatch.
- static decode_scalar_result(data: bytes) DecodedStreamResult[source]¶
- dau_driver.stream_codec._validate_header(header: dau_core.stream.BatchHeader, encoded_length: int) None[source]¶
- dau_driver.stream_codec._validate_column(header: dau_core.stream.BatchHeader, column: dau_core.stream.ColumnDescriptor, encoded_length: int) None[source]¶
- dau_driver.stream_codec._validate_operations(header: dau_core.stream.BatchHeader, operations: tuple[dau_core.stream.OperationDescriptor, ...]) None[source]¶
- dau_driver.stream_codec._validate_payload_window(payload_offset: int, payload_length: int, encoded_length: int) None[source]¶
- dau_driver.stream_codec._normalize_supported_type(logical_type: dau_core.stream.LogicalType) dau_core.stream.LogicalType[source]¶