Skip to content

Commit

Permalink
[Go] Fix fragment may not be recorded in manifest issue (#82)
Browse files Browse the repository at this point in the history
Signed-off-by: sunby <[email protected]>
  • Loading branch information
sunby committed Oct 20, 2023
1 parent 4dd296e commit d2ddcf3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/storage/transaction/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@ func (w *WriteOperation) Execute() error {
scalarFragment := fragment.NewFragment()
vectorFragment := fragment.NewFragment()

isEmpty := true
for w.reader.Next() {
rec := w.reader.Record()

if rec.NumRows() == 0 {
continue
}

var err error
scalarWriter, err = w.write(scalarSchema, rec, scalarWriter, &scalarFragment, w.options, true)
if err != nil {
Expand All @@ -126,6 +128,7 @@ func (w *WriteOperation) Execute() error {
if err != nil {
return err
}
isEmpty = false
}

if scalarWriter != nil {
Expand All @@ -139,7 +142,7 @@ func (w *WriteOperation) Execute() error {
}
}

if scalarWriter == nil {
if isEmpty {
return nil
}

Expand Down

0 comments on commit d2ddcf3

Please sign in to comment.