Skip to content

Commit f0f5382

Browse files
committed
fixed
1 parent 00a1381 commit f0f5382

File tree

1 file changed

+10
-5
lines changed
  • examples/bulk_upsert/apache_arrow

1 file changed

+10
-5
lines changed

examples/bulk_upsert/apache_arrow/main.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ func fillTopicCommits(ctx context.Context, db *ydb.Driver) {
9797

9898
err = json.Unmarshal(content, &commit)
9999
if err == nil {
100-
messages = append(messages, topicwriter.Message{Data: bytes.NewReader(scanner.Bytes())})
100+
data, err := json.Marshal(commit)
101+
if err != nil {
102+
panic(err)
103+
}
104+
105+
messages = append(messages, topicwriter.Message{Data: bytes.NewReader(data)})
101106

102107
date, err := time.Parse("2006-01-02 15:04:05", commit.Date)
103108
if err != nil {
@@ -290,10 +295,10 @@ func getCommitStats(ctx context.Context, db *ydb.Driver, year int) (commits int6
290295
if date.Year() == year {
291296
commits++
292297
}
293-
//} else {
294-
// fmt.Println(string(content))
295-
//
296-
// panic(err)
298+
} else {
299+
fmt.Println(string(content))
300+
301+
panic(err)
297302
}
298303
}
299304

0 commit comments

Comments
 (0)