This is an automated email from the ASF dual-hosted git repository.
robertwb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 0799bf8 Add a standard double coder urn.
new 88e1a93 Merge pull request #8166 Add a standard double coder.
0799bf8 is described below
commit 0799bf819a2dad3461697a561b8409f5d29ad463
Author: Robert Bradshaw <[email protected]>
AuthorDate: Fri Mar 29 11:21:50 2019 +0100
Add a standard double coder urn.
Also add support for the Python SDK.
---
model/pipeline/src/main/proto/beam_runner_api.proto | 5 +++++
sdks/python/apache_beam/coders/coders.py | 3 +++
2 files changed, 8 insertions(+)
diff --git a/model/pipeline/src/main/proto/beam_runner_api.proto
b/model/pipeline/src/main/proto/beam_runner_api.proto
index 4e819ed..fa2461f 100644
--- a/model/pipeline/src/main/proto/beam_runner_api.proto
+++ b/model/pipeline/src/main/proto/beam_runner_api.proto
@@ -554,6 +554,11 @@ message StandardCoders {
// Components: None
VARINT = 2 [(beam_urn) = "beam:coder:varint:v1"];
+ // Encodes the floating point value as a big-endian 64-bit integer
+ // according to the IEEE 754 double format bit layout.
+ // Components: None
+ DOUBLE = 11 [(beam_urn) = "beam:coder:double:v1"];
+
// Encodes an iterable of elements.
//
// The encoding for an iterable [e1...eN] of known length N is
diff --git a/sdks/python/apache_beam/coders/coders.py
b/sdks/python/apache_beam/coders/coders.py
index 2164161..7822d71 100644
--- a/sdks/python/apache_beam/coders/coders.py
+++ b/sdks/python/apache_beam/coders/coders.py
@@ -452,6 +452,9 @@ class FloatCoder(FastCoder):
return hash(type(self))
+Coder.register_structured_urn(common_urns.coders.DOUBLE.urn, FloatCoder)
+
+
class TimestampCoder(FastCoder):
"""A coder used for timeutil.Timestamp values."""