apache_beam.coders.row_coder module¶
-
class
apache_beam.coders.row_coder.
RowCoder
(schema)[source]¶ Bases:
apache_beam.coders.coders.FastCoder
Coder for typing.NamedTuple instances.
Implements the beam:coder:row:v1 standard coder spec.
Initializes a
RowCoder
.Parameters: schema (apache_beam.portability.api.schema_pb2.Schema) – The protobuf representation of the schema of the data that the RowCoder will be used to encode/decode. -
as_cloud_object
(coders_context=None)¶ For internal use only; no backwards-compatibility guarantees.
Returns Google Cloud Dataflow API description of this coder.
-
as_deterministic_coder
(step_label, error_message=None)¶ Returns a deterministic version of self, if possible.
Otherwise raises a value error.
-
decode
(encoded)¶ Decodes the given byte string into the corresponding object.
-
decode_nested
(encoded)¶ Uses the underlying implementation to decode in nested format.
-
encode
(value)¶ Encodes the given object into a byte string.
-
encode_nested
(value)¶ Uses the underlying implementation to encode in nested format.
-
estimate_size
(value)¶
-
classmethod
from_runner_api
(coder_proto, context)¶ Converts from an FunctionSpec to a Fn object.
Prefer registering a urn with its parameter type and constructor.
-
get_impl
()¶ For internal use only; no backwards-compatibility guarantees.
Returns the CoderImpl backing this Coder.
-
is_kv_coder
()¶
-
key_coder
()¶
-
static
register_structured_urn
(urn, cls)¶ Register a coder that’s completely defined by its urn and its component(s), if any, which are passed to construct the instance.
-
classmethod
register_urn
(urn, parameter_type, fn=None)¶ Registers a urn with a constructor.
For example, if ‘beam:fn:foo’ had parameter type FooPayload, one could write RunnerApiFn.register_urn(‘bean:fn:foo’, FooPayload, foo_from_proto) where foo_from_proto took as arguments a FooPayload and a PipelineContext. This function can also be used as a decorator rather than passing the callable in as the final parameter.
A corresponding to_runner_api_parameter method would be expected that returns the tuple (‘beam:fn:foo’, FooPayload)
-
to_runner_api
(context)¶
-
value_coder
()¶
-