From 50da11d92036c98c6b164ea2b3fc0e0d9b97fff6 Mon Sep 17 00:00:00 2001 From: redHJ <489534124@qq.com> Date: Thu, 28 Mar 2019 21:56:56 +0800 Subject: [PATCH 1/2] jsonstring map[string][string] --- sender/pandora/pandora.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sender/pandora/pandora.go b/sender/pandora/pandora.go index 0e7a8bdcc..bf32ec426 100644 --- a/sender/pandora/pandora.go +++ b/sender/pandora/pandora.go @@ -829,6 +829,9 @@ func validSchema(valueType string, value interface{}, numberAsFloat bool) bool { if _, ok := value.(map[string]interface{}); ok { return true } + if _, ok := value.(map[string]string); ok { + return true + } vu := reflect.ValueOf(value) var str string if vu.Kind() == reflect.String { From 421fca736b0f49c95e39eab6670cee1f20444bcf Mon Sep 17 00:00:00 2001 From: redHJ <489534124@qq.com> Date: Fri, 29 Mar 2019 10:02:24 +0800 Subject: [PATCH 2/2] update pandora go sdk --- .../pandora-go-sdk/pipeline/schemafree.go | 22 +++++------ vendor/vendor.json | 38 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/vendor/github.com/qiniu/pandora-go-sdk/pipeline/schemafree.go b/vendor/github.com/qiniu/pandora-go-sdk/pipeline/schemafree.go index ac3cb7b03..754022eca 100644 --- a/vendor/github.com/qiniu/pandora-go-sdk/pipeline/schemafree.go +++ b/vendor/github.com/qiniu/pandora-go-sdk/pipeline/schemafree.go @@ -1014,19 +1014,19 @@ func GetTrimedDataSchema(data Data) (valueType map[string]RepoSchemaEntry) { delete(data, k) continue } - - sc := formValueType(k, PandoraTypeMap) - for _, m := range follows { - sc.Schema = append(sc.Schema, m) - } - valueType[k] = sc + valueType[k] = formValueType(k, PandoraTypeJsonString) case map[string]string: - sc := formValueType(k, PandoraTypeMap) - for mapKey := range nv { - scFollow := formValueType(mapKey, PandoraTypeString) - sc.Schema = append(sc.Schema, scFollow) + isEmpty := true + for _, nvVal := range nv { + if nvVal != "" { + isEmpty = false + break + } } - valueType[k] = sc + if isEmpty { + continue + } + valueType[k] = formValueType(k, PandoraTypeJsonString) case []interface{}: sc := formValueType(k, PandoraTypeArray) if len(nv) > 0 { diff --git a/vendor/vendor.json b/vendor/vendor.json index d67b875ee..9ea561cbf 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -607,56 +607,56 @@ { "checksumSHA1": "0JEyusBC8nfE7dF2sKLylHTh93Y=", "path": "github.com/qiniu/pandora-go-sdk/base", - "revision": "e15960de1fd5083da45ff35b9cd3be252a5b29c0", - "revisionTime": "2019-03-27T11:09:52Z" + "revision": "2d846efd05291c2b225b2ccade668607859f12c7", + "revisionTime": "2019-03-29T02:01:01Z" }, { "checksumSHA1": "bxhdCtUVijjJI4tzfMBipi5G4ko=", "path": "github.com/qiniu/pandora-go-sdk/base/config", - "revision": "e15960de1fd5083da45ff35b9cd3be252a5b29c0", - "revisionTime": "2019-03-27T11:09:52Z" + "revision": "2d846efd05291c2b225b2ccade668607859f12c7", + "revisionTime": "2019-03-29T02:01:01Z" }, { "checksumSHA1": "k5JfcSQ5YsAFd6DSHpSeuNWbql8=", "path": "github.com/qiniu/pandora-go-sdk/base/models", - "revision": "e15960de1fd5083da45ff35b9cd3be252a5b29c0", - "revisionTime": "2019-03-27T11:09:52Z" + "revision": "2d846efd05291c2b225b2ccade668607859f12c7", + "revisionTime": "2019-03-29T02:01:01Z" }, { "checksumSHA1": "lV2zb3SZ4BKaa1XpC4Q3ktbVgDo=", "path": "github.com/qiniu/pandora-go-sdk/base/ratelimit", - "revision": "e15960de1fd5083da45ff35b9cd3be252a5b29c0", - "revisionTime": "2019-03-27T11:09:52Z" + "revision": "2d846efd05291c2b225b2ccade668607859f12c7", + "revisionTime": "2019-03-29T02:01:01Z" }, { "checksumSHA1": "v8UwIci5uK7slGpomJy18kQsHIQ=", "path": "github.com/qiniu/pandora-go-sdk/base/reqerr", - "revision": "e15960de1fd5083da45ff35b9cd3be252a5b29c0", - "revisionTime": "2019-03-27T11:09:52Z" + "revision": "2d846efd05291c2b225b2ccade668607859f12c7", + "revisionTime": "2019-03-29T02:01:01Z" }, { "checksumSHA1": "oEpRonb6KY/u9OWNOxSEjyyqqXk=", "path": "github.com/qiniu/pandora-go-sdk/base/request", - "revision": "e15960de1fd5083da45ff35b9cd3be252a5b29c0", - "revisionTime": "2019-03-27T11:09:52Z" + "revision": "2d846efd05291c2b225b2ccade668607859f12c7", + "revisionTime": "2019-03-29T02:01:01Z" }, { "checksumSHA1": "rJKQ0d5ynkO5c81IUfLyqb7iIqU=", "path": "github.com/qiniu/pandora-go-sdk/logdb", - "revision": "e15960de1fd5083da45ff35b9cd3be252a5b29c0", - "revisionTime": "2019-03-27T11:09:52Z" + "revision": "2d846efd05291c2b225b2ccade668607859f12c7", + "revisionTime": "2019-03-29T02:01:01Z" }, { - "checksumSHA1": "od+WNbbFTu/YMRFe4emAl6xCPUY=", + "checksumSHA1": "ld7LH305wTIazeBKzC+Le760q+Y=", "path": "github.com/qiniu/pandora-go-sdk/pipeline", - "revision": "e15960de1fd5083da45ff35b9cd3be252a5b29c0", - "revisionTime": "2019-03-27T11:09:52Z" + "revision": "2d846efd05291c2b225b2ccade668607859f12c7", + "revisionTime": "2019-03-29T02:01:01Z" }, { "checksumSHA1": "YeSUJIE3zLnpjK3g161wiMeIbmk=", "path": "github.com/qiniu/pandora-go-sdk/tsdb", - "revision": "e15960de1fd5083da45ff35b9cd3be252a5b29c0", - "revisionTime": "2019-03-27T11:09:52Z" + "revision": "2d846efd05291c2b225b2ccade668607859f12c7", + "revisionTime": "2019-03-29T02:01:01Z" }, { "checksumSHA1": "KAzbLjI9MzW2tjfcAsK75lVRp6I=",