From d6d4a4d70d1d073b1af2a06e922e57ae7bec8e7f Mon Sep 17 00:00:00 2001 From: "qiao.wei" Date: Wed, 17 Mar 2021 10:58:20 +0800 Subject: [PATCH 1/3] upgrade orc and fix loading badger config --- go.mod | 2 +- go.sum | 2 ++ internal/config/config.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 8f2ed05a..9cf23c7f 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/Knetic/govaluate v3.0.0+incompatible github.com/armon/go-metrics v0.3.3 // indirect github.com/aws/aws-sdk-go v1.30.25 - github.com/crphang/orc v0.0.3 + github.com/crphang/orc v0.0.6 github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200626160443-3042e3776798 github.com/dgraph-io/ristretto v0.0.2 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect diff --git a/go.sum b/go.sum index 400c4640..eb75bb61 100644 --- a/go.sum +++ b/go.sum @@ -113,6 +113,8 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/crphang/orc v0.0.3 h1:izgRzMsYn7vjkBKA33mN60qpBW8w8nLEDbnmQpSS95A= github.com/crphang/orc v0.0.3/go.mod h1:+siY09J77eYa8+0+UXZxeyv8nrmhvOY40DbqB7gRVhU= +github.com/crphang/orc v0.0.6 h1:wcmX6/Lg9YSxflFS+vpuQBoOUQv1ixE8Ihxmm4eQFxI= +github.com/crphang/orc v0.0.6/go.mod h1:+siY09J77eYa8+0+UXZxeyv8nrmhvOY40DbqB7gRVhU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/internal/config/config.go b/internal/config/config.go index e983d9e8..714d893d 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -59,7 +59,7 @@ type Table struct { // Storage is the location to write the data type Storage struct { - Badger + Badger `yaml:",inline"` Directory string `json:"dir" yaml:"dir" env:"DIR"` } From f5bb559b5017a493858293f084d2cdac9f980bef Mon Sep 17 00:00:00 2001 From: "qiao.wei" Date: Wed, 17 Mar 2021 13:02:38 +0800 Subject: [PATCH 2/3] fix encoder flaky test when iterating over map --- client/golang/encoding_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/golang/encoding_test.go b/client/golang/encoding_test.go index 807ffaa6..044d69e5 100644 --- a/client/golang/encoding_test.go +++ b/client/golang/encoding_test.go @@ -44,7 +44,7 @@ func TestEncoder(t *testing.T) { "topic": "movie", }, { - "event": "xyz", + "event": "abc", "nested": map[string]interface{}{ "level0": 0, "level1": map[string]interface{}{ @@ -69,5 +69,5 @@ func TestEncoder(t *testing.T) { assert.Equal(t, &pb.Event{Value: map[uint32]*pb.Value{5: {Value: &pb.Value_Time{Time: testTime.Unix()}}}}, res.Events[3]) assert.Equal(t, &pb.Event{Value: map[uint32]*pb.Value{6: {Value: &pb.Value_Json{Json: 7}}}}, res.Events[4]) assert.Equal(t, &pb.Event{Value: map[uint32]*pb.Value{6: {Value: &pb.Value_String_{String_: 8}}}}, res.Events[5]) - assert.Equal(t, &pb.Event{Value: map[uint32]*pb.Value{1: {Value: &pb.Value_String_{String_: 9}}, 14: {Value: &pb.Value_Json{Json: 15}}}}, res.Events[7]) + assert.Equal(t, &pb.Event{Value: map[uint32]*pb.Value{1: {Value: &pb.Value_String_{String_: 2}}, 14: {Value: &pb.Value_Json{Json: 15}}}}, res.Events[7]) } From 5888910f0dab7c3ee0260df74756ecaec5a3d918 Mon Sep 17 00:00:00 2001 From: "qiao.wei" Date: Wed, 17 Mar 2021 14:31:40 +0800 Subject: [PATCH 3/3] revert config change --- internal/config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/config/config.go b/internal/config/config.go index 714d893d..e983d9e8 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -59,7 +59,7 @@ type Table struct { // Storage is the location to write the data type Storage struct { - Badger `yaml:",inline"` + Badger Directory string `json:"dir" yaml:"dir" env:"DIR"` }