[ 
https://issues.apache.org/jira/browse/BEAM-3910?focusedWorklogId=88558&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-88558
 ]

ASF GitHub Bot logged work on BEAM-3910:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Apr/18 18:38
            Start Date: 06/Apr/18 18:38
    Worklog Time Spent: 10m 
      Work Description: lukecwik closed pull request #4941: BEAM-3910: Add 
float support for the Go SDK.
URL: https://github.com/apache/beam/pull/4941
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sdks/go/pkg/beam/coder.go b/sdks/go/pkg/beam/coder.go
index c7a2d4cabc5..b7f62186135 100644
--- a/sdks/go/pkg/beam/coder.go
+++ b/sdks/go/pkg/beam/coder.go
@@ -107,6 +107,13 @@ func inferCoder(t FullType) (*coder.Coder, error) {
                                return nil, err
                        }
                        return &coder.Coder{Kind: coder.Custom, T: t, Custom: 
c}, nil
+               case reflectx.Float32, reflectx.Float64:
+                       c, err := coderx.NewFloat(t.Type())
+                       if err != nil {
+                               return nil, err
+                       }
+                       return &coder.Coder{Kind: coder.Custom, T: t, Custom: 
c}, nil
+
                case reflectx.String, reflectx.ByteSlice:
                        // TODO(BEAM-3580): we should stop encoding string 
using the bytecoder. It forces
                        // conversions at runtime in inconvenient places.
diff --git a/sdks/go/pkg/beam/core/runtime/coderx/float.go 
b/sdks/go/pkg/beam/core/runtime/coderx/float.go
new file mode 100644
index 00000000000..403cd30ac1d
--- /dev/null
+++ b/sdks/go/pkg/beam/core/runtime/coderx/float.go
@@ -0,0 +1,75 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package coderx
+
+import (
+       "fmt"
+       "math"
+       "math/bits"
+       "reflect"
+
+       "github.com/apache/beam/sdks/go/pkg/beam/core/graph/coder"
+       "github.com/apache/beam/sdks/go/pkg/beam/core/runtime"
+       "github.com/apache/beam/sdks/go/pkg/beam/core/typex"
+       "github.com/apache/beam/sdks/go/pkg/beam/core/util/reflectx"
+)
+
+func init() {
+       runtime.RegisterFunction(encFloat)
+       runtime.RegisterFunction(decFloat)
+}
+
+func encFloat(v typex.T) []byte {
+       var val float64
+       switch n := v.(type) {
+       case float32:
+               val = float64(n)
+       case float64:
+               val = n
+       default:
+               panic(fmt.Sprintf("received unknown value type: want a float, 
got %T", n))
+       }
+
+       return encVarUintZ(bits.ReverseBytes64(math.Float64bits(val)))
+}
+
+func decFloat(t reflect.Type, data []byte) (typex.T, error) {
+       uval, err := decVarUintZ(reflectx.Uint64, data)
+       if err != nil {
+               return nil, fmt.Errorf("invalid float encoding for: %v", data)
+       }
+
+       n := math.Float64frombits(bits.ReverseBytes64(uval.(uint64)))
+       switch t.Kind() {
+       case reflect.Float64:
+               return n, nil
+       case reflect.Float32:
+               return float32(n), nil
+       default:
+               panic(fmt.Sprintf("unreachable statement: expected a float, got 
%v", t))
+       }
+}
+
+// NewFloat returns a coder for the given float type. It uses the same
+// encoding scheme as the gob package.
+func NewFloat(t reflect.Type) (*coder.CustomCoder, error) {
+       switch t.Kind() {
+       case reflect.Float32, reflect.Float64:
+               return coder.NewCustomCoder("float", t, encFloat, decFloat)
+       default:
+               return nil, fmt.Errorf("not a float type: %v", t)
+       }
+}
diff --git a/sdks/go/pkg/beam/core/runtime/coderx/float_test.go 
b/sdks/go/pkg/beam/core/runtime/coderx/float_test.go
new file mode 100644
index 00000000000..460057e900b
--- /dev/null
+++ b/sdks/go/pkg/beam/core/runtime/coderx/float_test.go
@@ -0,0 +1,50 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package coderx
+
+import (
+       "reflect"
+       "testing"
+
+       "github.com/apache/beam/sdks/go/pkg/beam/core/util/reflectx"
+)
+
+func TestFloat(t *testing.T) {
+       tests := []interface{}{
+               float32(0.0),
+               float32(94.5),
+               float64(-127.25),
+               float64(8675309.4286),
+       }
+
+       for _, v := range tests {
+               typ := reflect.ValueOf(v).Type()
+
+               data := encFloat(v)
+               result, err := decFloat(typ, data)
+               if err != nil {
+                       t.Fatalf("dec(enc(%v)) failed: %v", v, err)
+               }
+
+               if v != result {
+                       t.Errorf("dec(enc(%v)) = %v, want id", v, result)
+               }
+               resultT := 
reflectx.UnderlyingType(reflect.ValueOf(result)).Type()
+               if resultT != typ {
+                       t.Errorf("type(dec(enc(%v))) = %v, want id", typ, 
resultT)
+               }
+       }
+}
diff --git a/sdks/go/pkg/beam/core/runtime/graphx/serialize.go 
b/sdks/go/pkg/beam/core/runtime/graphx/serialize.go
index f38a698d391..5615b71dfbe 100644
--- a/sdks/go/pkg/beam/core/runtime/graphx/serialize.go
+++ b/sdks/go/pkg/beam/core/runtime/graphx/serialize.go
@@ -347,6 +347,10 @@ func encodeType(t reflect.Type) (*v1.Type, error) {
                return &v1.Type{Kind: v1.Type_UINT32}, nil
        case reflect.Uint64:
                return &v1.Type{Kind: v1.Type_UINT64}, nil
+       case reflect.Float32:
+               return &v1.Type{Kind: v1.Type_FLOAT32}, nil
+       case reflect.Float64:
+               return &v1.Type{Kind: v1.Type_FLOAT64}, nil
        case reflect.String:
                return &v1.Type{Kind: v1.Type_STRING}, nil
 
@@ -485,6 +489,10 @@ func decodeType(t *v1.Type) (reflect.Type, error) {
                return reflectx.Uint32, nil
        case v1.Type_UINT64:
                return reflectx.Uint64, nil
+       case v1.Type_FLOAT32:
+               return reflectx.Float32, nil
+       case v1.Type_FLOAT64:
+               return reflectx.Float64, nil
        case v1.Type_STRING:
                return reflectx.String, nil
 
diff --git a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go 
b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go
index 97f591f0700..94dfd64847a 100644
--- a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go
+++ b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.pb.go
@@ -42,18 +42,20 @@ type Type_Kind int32
 const (
        Type_INVALID Type_Kind = 0
        // Primitive.
-       Type_BOOL   Type_Kind = 1
-       Type_INT    Type_Kind = 2
-       Type_INT8   Type_Kind = 3
-       Type_INT16  Type_Kind = 4
-       Type_INT32  Type_Kind = 5
-       Type_INT64  Type_Kind = 6
-       Type_UINT   Type_Kind = 7
-       Type_UINT8  Type_Kind = 8
-       Type_UINT16 Type_Kind = 9
-       Type_UINT32 Type_Kind = 10
-       Type_UINT64 Type_Kind = 11
-       Type_STRING Type_Kind = 12
+       Type_BOOL    Type_Kind = 1
+       Type_INT     Type_Kind = 2
+       Type_INT8    Type_Kind = 3
+       Type_INT16   Type_Kind = 4
+       Type_INT32   Type_Kind = 5
+       Type_INT64   Type_Kind = 6
+       Type_UINT    Type_Kind = 7
+       Type_UINT8   Type_Kind = 8
+       Type_UINT16  Type_Kind = 9
+       Type_UINT32  Type_Kind = 10
+       Type_UINT64  Type_Kind = 11
+       Type_STRING  Type_Kind = 12
+       Type_FLOAT32 Type_Kind = 13
+       Type_FLOAT64 Type_Kind = 14
        // Non-primitive types.
        Type_SLICE    Type_Kind = 20
        Type_STRUCT   Type_Kind = 21
@@ -78,6 +80,8 @@ var Type_Kind_name = map[int32]string{
        10: "UINT32",
        11: "UINT64",
        12: "STRING",
+       13: "FLOAT32",
+       14: "FLOAT64",
        20: "SLICE",
        21: "STRUCT",
        22: "FUNC",
@@ -100,6 +104,8 @@ var Type_Kind_value = map[string]int32{
        "UINT32":   10,
        "UINT64":   11,
        "STRING":   12,
+       "FLOAT32":  13,
+       "FLOAT64":  14,
        "SLICE":    20,
        "STRUCT":   21,
        "FUNC":     22,
@@ -749,73 +755,74 @@ func init() {
 func init() { proto.RegisterFile("v1.proto", fileDescriptor0) }
 
 var fileDescriptor0 = []byte{
-       // 1079 bytes of a gzipped FileDescriptorProto
+       // 1091 bytes of a gzipped FileDescriptorProto
        0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 
0xdb, 0x6e, 0xdb, 0x46,
-       0x13, 0x0e, 0x45, 0x89, 0x87, 0x91, 0x94, 0x6c, 0xf6, 0x77, 0xfc, 0x33, 
0x46, 0x8a, 0x28, 0xbc,
-       0xa9, 0xda, 0x18, 0x2a, 0x2c, 0x07, 0x46, 0xd1, 0x3b, 0x45, 0xa2, 0x1d, 
0xc2, 0x32, 0x25, 0xac,
+       0x13, 0x0e, 0x45, 0x89, 0x87, 0x91, 0xe4, 0x6c, 0xf6, 0x77, 0xfc, 0x33, 
0x46, 0x8a, 0x28, 0xbc,
+       0xa9, 0xda, 0x18, 0x2a, 0x2c, 0x1b, 0x46, 0xd1, 0x3b, 0x45, 0xa2, 0x1c, 
0xc2, 0x34, 0x25, 0xac,
        0x28, 0xd9, 0xe9, 0x8d, 0xc0, 0x88, 0x2b, 0x99, 0xb5, 0xb4, 0x64, 0x49, 
0xca, 0x88, 0xd0, 0x57,
-       0x29, 0xfa, 0x1c, 0x7d, 0x87, 0x3e, 0x47, 0xde, 0xa3, 0xd8, 0x25, 0x29, 
0x5b, 0xae, 0x8b, 0x02,
-       0xb9, 0xda, 0xd9, 0x99, 0xef, 0xdb, 0x39, 0xec, 0xec, 0x90, 0xa0, 0xdd, 
0x1e, 0xb5, 0xa2, 0x38,
-       0x4c, 0x43, 0x5c, 0xba, 0x3d, 0x32, 0xbf, 0xa8, 0x50, 0x76, 0x37, 0x11, 
0xc5, 0x6f, 0xa0, 0x7c,
-       0x13, 0x30, 0xdf, 0x90, 0x1a, 0x52, 0xf3, 0x69, 0xbb, 0xde, 0xba, 0x3d, 
0x6a, 0x71, 0x7d, 0xeb,
-       0x3c, 0x60, 0x3e, 0x11, 0x26, 0x6c, 0x82, 0x4a, 0x97, 0x74, 0x45, 0x59, 
0x6a, 0x94, 0x1a, 0x52,
-       0xb3, 0xda, 0xd6, 0x0a, 0x14, 0x29, 0x0c, 0xf8, 0x10, 0x94, 0x79, 0x40, 
0x97, 0x7e, 0x62, 0xc8,
-       0x0d, 0xb9, 0x59, 0x6d, 0xef, 0x6d, 0x0f, 0x1a, 0xa5, 0xf1, 0x7a, 0x96, 
0x9e, 0x72, 0x23, 0xc9,
-       0x31, 0xf8, 0x08, 0x9e, 0x45, 0x5e, 0xec, 0xad, 0x68, 0x4a, 0xe3, 0x69, 
0xba, 0x89, 0x68, 0x62,
-       0x94, 0x05, 0xed, 0xee, 0xe4, 0xa7, 0x5b, 0x00, 0xdf, 0x26, 0xf8, 0x2d, 
0xd4, 0x62, 0x9a, 0xae,
-       0x63, 0x96, 0xe3, 0x2b, 0x0f, 0xf0, 0xd5, 0xcc, 0x9a, 0x81, 0x5f, 0x43, 
0x35, 0x48, 0xa6, 0xb7,
-       0x5e, 0x1c, 0x78, 0x7e, 0x30, 0x33, 0x94, 0x86, 0xd4, 0xd4, 0x08, 0x04, 
0xc9, 0x24, 0xd7, 0xe0,
-       0xb7, 0xa0, 0xcd, 0xae, 0x3d, 0x36, 0xf5, 0x83, 0xd8, 0x50, 0x45, 0xe6, 
0x68, 0x1b, 0x70, 0xf7,
-       0xda, 0x63, 0xbd, 0x20, 0x26, 0xea, 0x2c, 0x13, 0xf0, 0xf7, 0xa0, 0x26, 
0x11, 0x9d, 0x05, 0xde,
-       0xd2, 0xd0, 0x1e, 0x60, 0x47, 0x99, 0x9e, 0x14, 0x00, 0xfc, 0x06, 0x6a, 
0xf4, 0x73, 0x4a, 0x63,
-       0xe6, 0x2d, 0xa7, 0x37, 0x74, 0x63, 0xe8, 0x0d, 0xa9, 0xa9, 0x93, 0x6a, 
0xa1, 0x3b, 0xa7, 0x9b,
-       0x83, 0x3f, 0x25, 0xa8, 0xde, 0x2b, 0x0a, 0xc6, 0x50, 0x66, 0xde, 0x8a, 
0x8a, 0x1b, 0xd0, 0x89,
-       0x90, 0xf1, 0x4b, 0xd0, 0xa2, 0x9b, 0xc5, 0x34, 0xf2, 0xd2, 0x6b, 0x51, 
0x73, 0x9d, 0xa8, 0xd1,
-       0xcd, 0x62, 0xe8, 0xa5, 0xd7, 0xf8, 0x15, 0x94, 0x79, 0x05, 0x0c, 0xf9, 
0xc1, 0x55, 0x08, 0x2d,
-       0x46, 0x20, 0xa7, 0xde, 0xc2, 0x28, 0x0b, 0x0e, 0x17, 0xf1, 0x3e, 0x28, 
0xe1, 0x7c, 0x9e, 0xd0,
-       0xd4, 0xa8, 0x34, 0xa4, 0xa6, 0x4c, 0xf2, 0x1d, 0xde, 0x83, 0x4a, 0xc0, 
0x7c, 0xfa, 0xd9, 0x50,
-       0x1a, 0x72, 0xb3, 0x42, 0xb2, 0x0d, 0x7e, 0x05, 0xba, 0xc7, 0x42, 0xb6, 
0x59, 0x85, 0xeb, 0x44,
-       0x54, 0x46, 0x23, 0x77, 0x0a, 0xf3, 0x8b, 0x04, 0x65, 0xde, 0x18, 0xb8, 
0x0a, 0xaa, 0xed, 0x4c,
-       0x3a, 0x7d, 0xbb, 0x87, 0x9e, 0x60, 0x0d, 0xca, 0xef, 0x07, 0x83, 0x3e, 
0x92, 0xb0, 0x0a, 0xb2,
-       0xed, 0xb8, 0xa8, 0xc4, 0x55, 0xb6, 0xe3, 0xfe, 0x88, 0x64, 0xac, 0x43, 
0xc5, 0x76, 0xdc, 0xa3,
-       0x13, 0x54, 0xce, 0xc5, 0xe3, 0x36, 0xaa, 0xe4, 0xe2, 0xc9, 0x3b, 0xa4, 
0x70, 0xe8, 0x98, 0x93,
-       0x54, 0xae, 0x1c, 0x0b, 0x96, 0x86, 0x01, 0x94, 0x71, 0x46, 0xd3, 0x0b, 
0xf9, 0xb8, 0x8d, 0xa0,
-       0x90, 0x4f, 0xde, 0xa1, 0x2a, 0x97, 0x47, 0x2e, 0xb1, 0x9d, 0x33, 0x54, 
0xe3, 0xd4, 0x51, 0xdf,
-       0xee, 0x5a, 0x68, 0x2f, 0x57, 0x8f, 0xbb, 0x2e, 0x7a, 0xc1, 0xcf, 0x3e, 
0x1d, 0x3b, 0x5d, 0xb4,
-       0xcf, 0xa5, 0xee, 0x87, 0x8e, 0x83, 0xfe, 0xcf, 0x63, 0x1c, 0xba, 0x04, 
0x19, 0x3c, 0x87, 0xd1,
-       0xd0, 0xea, 0xda, 0x9d, 0x3e, 0x7a, 0x89, 0x6b, 0xa0, 0x59, 0x57, 0xae, 
0x45, 0x9c, 0x4e, 0x1f,
-       0x1d, 0x98, 0xdf, 0x82, 0x9a, 0x77, 0x01, 0x27, 0x12, 0xab, 0x3b, 0xc9, 
0xd2, 0x1c, 0x59, 0x4e,
-       0x0f, 0x49, 0x59, 0xc2, 0xee, 0x07, 0x54, 0x32, 0xff, 0x90, 0x40, 0xcd, 
0x7b, 0x40, 0xd4, 0xa4,
-       0xdf, 0xb7, 0xce, 0x3a, 0x7d, 0xf4, 0x84, 0x07, 0x64, 0x11, 0x32, 0x20, 
0x48, 0xe2, 0xfa, 0xee,
-       0xc0, 0x71, 0xad, 0xab, 0xbc, 0x30, 0xee, 0xc7, 0xa1, 0x85, 0x64, 0x5c, 
0x07, 0xdd, 0x9a, 0x58,
-       0x8e, 0xeb, 0xda, 0x17, 0x16, 0x02, 0xac, 0x40, 0xe9, 0x7c, 0x82, 0xaa, 
0x9c, 0xd8, 0x1d, 0x9c,
-       0xbd, 0x3f, 0x47, 0x75, 0xfc, 0x1c, 0xea, 0x97, 0xb6, 0xd3, 0x1b, 0x5c, 
0x5a, 0xbd, 0x49, 0xa7,
-       0x3f, 0xb6, 0xd0, 0x53, 0x5c, 0x01, 0xc9, 0x45, 0xcf, 0xf8, 0x32, 0x46, 
0x88, 0x2f, 0x13, 0xf4,
-       0x9c, 0x2f, 0x97, 0x08, 0xf3, 0xe5, 0x0a, 0xfd, 0x8f, 0x2f, 0x1f, 0xd1, 
0x1e, 0x5f, 0x7e, 0x46,
-       0x2f, 0xcc, 0x09, 0x68, 0xa7, 0xeb, 0xe5, 0x52, 0x3c, 0xf5, 0xa2, 0x73, 
0xa4, 0x47, 0x3b, 0xe7,
-       0x10, 0x60, 0x16, 0xae, 0xa2, 0x90, 0x51, 0x96, 0x26, 0x46, 0x49, 0x3c, 
0xaf, 0x1a, 0xc7, 0x14,
-       0x7c, 0x72, 0xcf, 0x6e, 0xfe, 0x04, 0xca, 0x38, 0xa1, 0xf1, 0x29, 0x7b, 
0xb4, 0x7d, 0x0b, 0x4f,
-       0xa5, 0xc7, 0x3c, 0x99, 0x53, 0xa8, 0xf4, 0x36, 0xec, 0x6b, 0xa8, 0x9c, 
0xe1, 0x7b, 0xa9, 0x27,
-       0x9a, 0xbf, 0x46, 0x84, 0xcc, 0x5b, 0x7e, 0x41, 0x59, 0xd1, 0xf2, 0x0b, 
0xca, 0xcc, 0x5f, 0xa1,
-       0x74, 0xca, 0xf0, 0x01, 0x94, 0xe6, 0x2c, 0x4f, 0x16, 0xf8, 0x39, 0x59, 
0xc0, 0xa4, 0x34, 0x67,
-       0xff, 0xe1, 0x05, 0x81, 0x1c, 0x46, 0xa9, 0x70, 0xa2, 0x13, 0x2e, 0xe2, 
0xd7, 0x50, 0xf1, 0x37,
-       0x6c, 0x9e, 0x79, 0xa9, 0xb6, 0x75, 0x4e, 0x10, 0x39, 0x90, 0x4c, 0x6f, 
0xfe, 0x06, 0xd5, 0xee,
-       0x3a, 0x49, 0xc3, 0x55, 0x37, 0xf4, 0x69, 0xfc, 0x15, 0x99, 0xbd, 0x02, 
0x99, 0xb2, 0x59, 0xfe,
-       0xaa, 0xef, 0x87, 0xcb, 0xd5, 0xdc, 0xea, 0xd3, 0x59, 0xee, 0x7d, 0xc7, 
0xea, 0xd3, 0x99, 0xf9,
-       0xbb, 0x0c, 0xfa, 0xc5, 0x7a, 0x99, 0x06, 0x96, 0xbf, 0xa0, 0x78, 0xff, 
0x5e, 0xde, 0x8a, 0xb8,
-       0xc0, 0x2c, 0x67, 0x3e, 0x08, 0xa2, 0x59, 0xe8, 0xd3, 0xbc, 0x54, 0xf9, 
0x0e, 0xff, 0x00, 0x6a,
-       0xc0, 0x3e, 0x85, 0x6b, 0xe6, 0xe7, 0xb7, 0xfe, 0x82, 0x93, 0xb6, 0xe7, 
0xb5, 0xec, 0xcc, 0x48,
-       0x0a, 0x14, 0x6e, 0x83, 0x16, 0xae, 0xd3, 0x8c, 0x91, 0x4d, 0xfb, 0xfd, 
0x5d, 0xc6, 0x20, 0xb7,
-       0x92, 0x2d, 0xee, 0xe0, 0x2f, 0x09, 0xd4, 0xfc, 0x20, 0x7c, 0xbc, 0xf3, 
0xc9, 0x79, 0xfd, 0xa8,
-       0xb7, 0x96, 0xcd, 0xa2, 0x75, 0x7a, 0xef, 0x23, 0xd4, 0xd8, 0xa9, 0xde, 
0x6e, 0x63, 0x66, 0x6d,
-       0x15, 0x80, 0xbe, 0x25, 0xfd, 0x63, 0x40, 0x5d, 0x74, 0x6c, 0x07, 0x49, 
0xfc, 0xd1, 0x8d, 0x6c,
-       0xe7, 0xac, 0x6f, 0xb9, 0x03, 0x07, 0x95, 0xee, 0xc6, 0x86, 0xcc, 0xc7, 
0xc2, 0x45, 0x67, 0x88,
-       0xca, 0x7c, 0x12, 0x5c, 0x8c, 0xfb, 0xae, 0xcd, 0x77, 0x15, 0x31, 0xc8, 
0x5c, 0x8b, 0x20, 0x85,
-       0xcf, 0x15, 0x62, 0x09, 0x59, 0x3d, 0x38, 0x04, 0xad, 0xc8, 0x71, 0x1b, 
0x98, 0xf4, 0xaf, 0x81,
-       0x7d, 0x03, 0x75, 0x9b, 0xfd, 0x42, 0x67, 0xe9, 0xd0, 0xdb, 0x2c, 0x43, 
0xcf, 0xc7, 0x35, 0x90,
-       0xb2, 0x0b, 0xaa, 0x10, 0x89, 0x99, 0x31, 0x20, 0x37, 0xf6, 0x58, 0x32, 
0x0f, 0xe3, 0x55, 0x81,
-       0x40, 0x20, 0xaf, 0x63, 0x96, 0xb7, 0x0f, 0x17, 0xf9, 0x77, 0x9a, 0xfa, 
0x8b, 0x22, 0xff, 0xfa,
-       0x4e, 0xd1, 0x88, 0x30, 0xe1, 0xef, 0x40, 0x09, 0x84, 0x9f, 0xbc, 0x8b, 
0x9e, 0x73, 0xd0, 0x8e,
-       0x67, 0x92, 0x03, 0x3e, 0x29, 0xe2, 0x4f, 0xe0, 0xf8, 0xef, 0x00, 0x00, 
0x00, 0xff, 0xff, 0x6b,
-       0x77, 0x19, 0xb6, 0x15, 0x08, 0x00, 0x00,
+       0x29, 0xfa, 0x1c, 0x7d, 0x87, 0x3e, 0x54, 0x8a, 0xe5, 0x41, 0xb6, 0x5c, 
0x17, 0x05, 0x72, 0xb5,
+       0xb3, 0x33, 0xdf, 0xb7, 0x73, 0xd8, 0xd9, 0x21, 0x41, 0xb9, 0x3b, 0x6e, 
0x85, 0x51, 0x90, 0x04,
+       0xb8, 0x74, 0x77, 0xac, 0x7f, 0x91, 0xa1, 0xec, 0x6c, 0x42, 0x8a, 0xdf, 
0x42, 0xf9, 0xd6, 0x67,
+       0x9e, 0x26, 0x34, 0x84, 0xe6, 0x5e, 0xbb, 0xde, 0xba, 0x3b, 0x6e, 0x71, 
0x7d, 0xeb, 0xc2, 0x67,
+       0x1e, 0x49, 0x4d, 0x58, 0x07, 0x99, 0x2e, 0xe9, 0x8a, 0xb2, 0x44, 0x2b, 
0x35, 0x84, 0x66, 0xb5,
+       0xad, 0x14, 0x28, 0x52, 0x18, 0xf0, 0x11, 0x48, 0x73, 0x9f, 0x2e, 0xbd, 
0x58, 0x13, 0x1b, 0x62,
+       0xb3, 0xda, 0xde, 0xdf, 0x1e, 0x34, 0x4a, 0xa2, 0xf5, 0x2c, 0xe9, 0x73, 
0x23, 0xc9, 0x31, 0xf8,
+       0x18, 0x9e, 0x87, 0x6e, 0xe4, 0xae, 0x68, 0x42, 0xa3, 0x69, 0xb2, 0x09, 
0x69, 0xac, 0x95, 0x53,
+       0xda, 0xfd, 0xc9, 0x7b, 0x5b, 0x00, 0xdf, 0xc6, 0xf8, 0x1d, 0xd4, 0x22, 
0x9a, 0xac, 0x23, 0x96,
+       0xe3, 0x2b, 0x8f, 0xf0, 0xd5, 0xcc, 0x9a, 0x81, 0xdf, 0x40, 0xd5, 0x8f, 
0xa7, 0x77, 0x6e, 0xe4,
+       0xbb, 0x9e, 0x3f, 0xd3, 0xa4, 0x86, 0xd0, 0x54, 0x08, 0xf8, 0xf1, 0x24, 
0xd7, 0xe0, 0x77, 0xa0,
+       0xcc, 0x6e, 0x5c, 0x36, 0xf5, 0xfc, 0x48, 0x93, 0xd3, 0xcc, 0xd1, 0x36, 
0xe0, 0xee, 0x8d, 0xcb,
+       0x7a, 0x7e, 0x44, 0xe4, 0x59, 0x26, 0xe0, 0xef, 0x41, 0x8e, 0x43, 0x3a, 
0xf3, 0xdd, 0xa5, 0xa6,
+       0x3c, 0xc2, 0x8e, 0x32, 0x3d, 0x29, 0x00, 0xf8, 0x2d, 0xd4, 0xe8, 0xe7, 
0x84, 0x46, 0xcc, 0x5d,
+       0x4e, 0x6f, 0xe9, 0x46, 0x53, 0x1b, 0x42, 0x53, 0x25, 0xd5, 0x42, 0x77, 
0x41, 0x37, 0x87, 0x7f,
+       0x0a, 0x50, 0x7d, 0x50, 0x14, 0x8c, 0xa1, 0xcc, 0xdc, 0x15, 0x4d, 0x6f, 
0x40, 0x25, 0xa9, 0x8c,
+       0x5f, 0x81, 0x12, 0xde, 0x2e, 0xa6, 0xa1, 0x9b, 0xdc, 0xa4, 0x35, 0x57, 
0x89, 0x1c, 0xde, 0x2e,
+       0x86, 0x6e, 0x72, 0x83, 0x5f, 0x43, 0x99, 0x57, 0x40, 0x13, 0x1f, 0x5d, 
0x45, 0xaa, 0xc5, 0x08,
+       0xc4, 0xc4, 0x5d, 0x68, 0xe5, 0x94, 0xc3, 0x45, 0x7c, 0x00, 0x52, 0x30, 
0x9f, 0xc7, 0x34, 0xd1,
+       0x2a, 0x0d, 0xa1, 0x29, 0x92, 0x7c, 0x87, 0xf7, 0xa1, 0xe2, 0x33, 0x8f, 
0x7e, 0xd6, 0xa4, 0x86,
+       0xd8, 0xac, 0x90, 0x6c, 0x83, 0x5f, 0x83, 0xea, 0xb2, 0x80, 0x6d, 0x56, 
0xc1, 0x3a, 0x4e, 0x2b,
+       0xa3, 0x90, 0x7b, 0x85, 0xfe, 0x45, 0x80, 0x32, 0x6f, 0x0c, 0x5c, 0x05, 
0xd9, 0xb4, 0x27, 0x1d,
+       0xcb, 0xec, 0xa1, 0x67, 0x58, 0x81, 0xf2, 0xfb, 0xc1, 0xc0, 0x42, 0x02, 
0x96, 0x41, 0x34, 0x6d,
+       0x07, 0x95, 0xb8, 0xca, 0xb4, 0x9d, 0x1f, 0x91, 0x88, 0x55, 0xa8, 0x98, 
0xb6, 0x73, 0x7c, 0x86,
+       0xca, 0xb9, 0x78, 0xd2, 0x46, 0x95, 0x5c, 0x3c, 0x3b, 0x45, 0x12, 0x87, 
0x8e, 0x39, 0x49, 0xe6,
+       0xca, 0x71, 0xca, 0x52, 0x30, 0x80, 0x34, 0xce, 0x68, 0x6a, 0x21, 0x9f, 
0xb4, 0x11, 0x14, 0xf2,
+       0xd9, 0x29, 0xaa, 0x72, 0x79, 0xe4, 0x10, 0xd3, 0x3e, 0x47, 0x35, 0x1e, 
0x4f, 0xdf, 0x1a, 0x74,
+       0x38, 0xa8, 0xbe, 0xdd, 0x9c, 0x9d, 0xa2, 0x3d, 0x7e, 0xe8, 0xc8, 0x32, 
0xbb, 0x06, 0xda, 0xcf,
+       0x09, 0xe3, 0xae, 0x83, 0x5e, 0x72, 0xaf, 0xfd, 0xb1, 0xdd, 0x45, 0x07, 
0x5c, 0xea, 0x7e, 0xe8,
+       0xd8, 0xe8, 0xff, 0x3c, 0xfa, 0xa1, 0x43, 0x90, 0xc6, 0x0f, 0x18, 0x0d, 
0x8d, 0xae, 0xd9, 0xb1,
+       0xd0, 0x2b, 0x5c, 0x03, 0xc5, 0xb8, 0x76, 0x0c, 0x62, 0x77, 0x2c, 0x74, 
0xa8, 0x7f, 0x0b, 0x72,
+       0xde, 0x1f, 0x9c, 0x48, 0x8c, 0xee, 0x24, 0x2b, 0xc0, 0xc8, 0xb0, 0x7b, 
0x48, 0xc8, 0x4a, 0xe1,
+       0x7c, 0x40, 0x25, 0xfd, 0x0f, 0x01, 0xe4, 0xbc, 0x3b, 0xd2, 0x6a, 0x59, 
0x96, 0x71, 0xde, 0xb1,
+       0xd0, 0x33, 0x1e, 0x90, 0x41, 0xc8, 0x80, 0x20, 0x81, 0xeb, 0xbb, 0x03, 
0xdb, 0x31, 0xae, 0xf3,
+       0x92, 0x39, 0x1f, 0x87, 0x06, 0x12, 0x71, 0x1d, 0x54, 0x63, 0x62, 0xd8, 
0x8e, 0x63, 0x5e, 0x1a,
+       0x08, 0xb0, 0x04, 0xa5, 0x8b, 0x09, 0xaa, 0x72, 0x62, 0x77, 0x70, 0xfe, 
0xfe, 0x02, 0xd5, 0xf1,
+       0x0b, 0xa8, 0x5f, 0x99, 0x76, 0x6f, 0x70, 0x65, 0xf4, 0x26, 0x1d, 0x6b, 
0x6c, 0xa0, 0x3d, 0x5c,
+       0x01, 0xc1, 0x41, 0xcf, 0xf9, 0x32, 0x46, 0x88, 0x2f, 0x13, 0xf4, 0x82, 
0x2f, 0x57, 0x08, 0xf3,
+       0xe5, 0x1a, 0xfd, 0x8f, 0x2f, 0x1f, 0xd1, 0x3e, 0x5f, 0x7e, 0x46, 0x2f, 
0xf5, 0x09, 0x28, 0xfd,
+       0xf5, 0x72, 0x99, 0x0e, 0x81, 0xa2, 0xa7, 0x84, 0x27, 0x7b, 0xea, 0x08, 
0x60, 0x16, 0xac, 0xc2,
+       0x80, 0x51, 0x96, 0xc4, 0x5a, 0x29, 0x7d, 0x78, 0x35, 0x8e, 0x29, 0xf8, 
0xe4, 0x81, 0x5d, 0xff,
+       0x09, 0xa4, 0x71, 0x4c, 0xa3, 0x3e, 0x7b, 0xb2, 0xb1, 0x0b, 0x4f, 0xa5, 
0xa7, 0x3c, 0xe9, 0x53,
+       0xa8, 0xf4, 0x36, 0xec, 0x6b, 0xa8, 0x9c, 0xe1, 0xb9, 0x89, 0x9b, 0x3e, 
0x8b, 0x1a, 0x49, 0x65,
+       0xfe, 0x18, 0x16, 0x94, 0x15, 0x8f, 0x61, 0x41, 0x99, 0xfe, 0x2b, 0x94, 
0xfa, 0x0c, 0x1f, 0x42,
+       0x69, 0xce, 0xf2, 0x64, 0x81, 0x9f, 0x93, 0x05, 0x4c, 0x4a, 0x73, 0xf6, 
0x1f, 0x5e, 0x10, 0x88,
+       0x41, 0x98, 0xa4, 0x4e, 0x54, 0xc2, 0x45, 0xfc, 0x06, 0x2a, 0xde, 0x86, 
0xcd, 0x33, 0x2f, 0xd5,
+       0xb6, 0xca, 0x09, 0x69, 0x0e, 0x24, 0xd3, 0xeb, 0xbf, 0x41, 0xb5, 0xbb, 
0x8e, 0x93, 0x60, 0xd5,
+       0x0d, 0x3c, 0x1a, 0x7d, 0x45, 0x66, 0xaf, 0x41, 0xa4, 0x6c, 0x96, 0xbf, 
0xf7, 0x87, 0xe1, 0x72,
+       0x35, 0xb7, 0x7a, 0x74, 0x96, 0x7b, 0xdf, 0xb1, 0x7a, 0x74, 0xa6, 0xff, 
0x2e, 0x82, 0x7a, 0xb9,
+       0x5e, 0x26, 0xbe, 0xe1, 0x2d, 0x28, 0x3e, 0x78, 0x90, 0xb7, 0x94, 0x5e, 
0x60, 0x96, 0x33, 0x1f,
+       0x11, 0xe1, 0x2c, 0xf0, 0x68, 0x5e, 0xaa, 0x7c, 0x87, 0x7f, 0x00, 0xd9, 
0x67, 0x9f, 0x82, 0x35,
+       0xf3, 0xf2, 0x5b, 0x7f, 0xc9, 0x49, 0xdb, 0xf3, 0x5a, 0x66, 0x66, 0x24, 
0x05, 0x0a, 0xb7, 0x41,
+       0x09, 0xd6, 0x49, 0xc6, 0xc8, 0xbe, 0x03, 0x07, 0xbb, 0x8c, 0x41, 0x6e, 
0x25, 0x5b, 0xdc, 0xe1,
+       0x5f, 0x02, 0xc8, 0xf9, 0x41, 0xf8, 0x64, 0xe7, 0x63, 0xf4, 0xe6, 0x49, 
0x6f, 0x2d, 0x93, 0x85,
+       0xeb, 0xe4, 0xc1, 0xe7, 0xa9, 0xb1, 0x53, 0xbd, 0xdd, 0xc6, 0xcc, 0xda, 
0xca, 0x07, 0x75, 0x4b,
+       0xfa, 0xc7, 0xe8, 0xba, 0xec, 0x98, 0x36, 0x12, 0xf8, 0xa3, 0x1b, 0x99, 
0xf6, 0xb9, 0x65, 0x38,
+       0x03, 0x1b, 0x95, 0xee, 0xc7, 0x86, 0xc8, 0xc7, 0xc2, 0x65, 0x67, 0x88, 
0xca, 0x7c, 0x12, 0x5c,
+       0x8e, 0x2d, 0xc7, 0xe4, 0xbb, 0x4a, 0x3a, 0xe2, 0x1c, 0x83, 0x20, 0x89, 
0xcf, 0x15, 0x62, 0xa4,
+       0xb2, 0x7c, 0x78, 0x04, 0x4a, 0x91, 0xe3, 0x36, 0x30, 0xe1, 0x5f, 0x03, 
0xfb, 0x06, 0xea, 0x26,
+       0xfb, 0x85, 0xce, 0x92, 0xa1, 0xbb, 0x59, 0x06, 0xae, 0x87, 0x6b, 0x20, 
0x64, 0x17, 0x54, 0x21,
+       0x02, 0xd3, 0x23, 0x40, 0x4e, 0xe4, 0xb2, 0x78, 0x1e, 0x44, 0xab, 0x02, 
0x81, 0x40, 0x5c, 0x47,
+       0x2c, 0x6f, 0x1f, 0x2e, 0xf2, 0x2f, 0x38, 0xf5, 0x16, 0x45, 0xfe, 0xf5, 
0x9d, 0xa2, 0x91, 0xd4,
+       0x84, 0xbf, 0x03, 0xc9, 0x4f, 0xfd, 0xe4, 0x5d, 0xf4, 0x82, 0x83, 0x76, 
0x3c, 0x93, 0x1c, 0xf0,
+       0x49, 0x4a, 0xff, 0x11, 0x4e, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x4c, 
0x68, 0x2d, 0xd6, 0x2f,
+       0x08, 0x00, 0x00,
 }
diff --git a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto 
b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto
index a1a357312ca..273cf2ef82c 100644
--- a/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto
+++ b/sdks/go/pkg/beam/core/runtime/graphx/v1/v1.proto
@@ -46,6 +46,8 @@ message Type {
         UINT32 = 10;
         UINT64 = 11;
         STRING = 12;
+        FLOAT32 = 13;
+        FLOAT64 = 14;
 
         // Non-primitive types.
         SLICE = 20;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 88558)
            Time Spent: 1.5h  (was: 1h 20m)
    Remaining Estimate: 22.5h  (was: 22h 40m)

> Support floating point values in Go SDK
> ---------------------------------------
>
>                 Key: BEAM-3910
>                 URL: https://issues.apache.org/jira/browse/BEAM-3910
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-go
>            Reporter: Bill Neubauer
>            Assignee: Bill Neubauer
>            Priority: Major
>   Original Estimate: 24h
>          Time Spent: 1.5h
>  Remaining Estimate: 22.5h
>
> The Go SDK supports all the integer types of the language, but does not 
> support floats.
> My plan for coding is to use the same technique the gob package uses, which 
> results in a compact encoding for simple values.
> [https://golang.org/src/encoding/gob/encode.go?#L210|https://golang.org/src/encoding/gob/encode.go#L210]
>  with rationale explained in 
> https://golang.org/pkg/encoding/gob/#hdr-Encoding_Details
> The resulting uint is then encoded using the existing coders in coderx.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to