From c3ff544d0068f7b1c8af75d7d5aa9c53a2eda9ea Mon Sep 17 00:00:00 2001 From: Tony Wang Date: Thu, 18 Oct 2018 16:43:58 +0800 Subject: [PATCH] fix incompatible Record struct in KCL v2 --- kcl/kcl.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kcl/kcl.go b/kcl/kcl.go index b1f37cd..5949caf 100644 --- a/kcl/kcl.go +++ b/kcl/kcl.go @@ -59,11 +59,13 @@ type ActionInitialize struct { } type Record struct { - SequenceNumber string `json:"sequenceNumber"` - SubSequenceNumber int `json:"subSequenceNumber"` - ApproximateArrivalTimestamp int `json:"approximateArrivalTimestamp"` - PartitionKey string `json:"partitionKey"` - Data string `json:"data"` + SequenceNumber string `json:"sequenceNumber"` + SubSequenceNumber int `json:"subSequenceNumber"` + PartitionKey string `json:"partitionKey"` + Data string `json:"data"` + // KCL v2 has a different format, causing failure when json.Unmarshal. + // This is not used anywhere currently, so commenting it out. + //ApproximateArrivalTimestamp int `json:"approximateArrivalTimestamp"` } type ActionProcessRecords struct {