Skip to content

Commit b517360

Browse files
authored
Merge pull request #1 from mrproliu/support-drop-with-empty
Support drop segment with to empty
2 parents c3d8eea + 261bd7e commit b517360

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

load.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ func (s *Segment) loadFields() error {
138138

139139
// loadStoredFieldChunk load storedField chunk offsets
140140
func (s *Segment) loadStoredFieldChunk() error {
141+
if s.footer.storedIndexOffset == 0 {
142+
return nil
143+
}
141144
// read chunk num
142145
chunkOffsetPos := int(s.footer.storedIndexOffset - uint64(sizeOfUint32))
143146
chunkData, err := s.data.Read(chunkOffsetPos, chunkOffsetPos+sizeOfUint32)

merge.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ func mergeToWriter(segments []*Segment, drops []*roaring.Bitmap,
153153
}
154154
} else {
155155
dictLocs = make([]uint64, len(fieldsInv))
156+
newDocNums = make([][]uint64, len(segments))
156157
}
157158

158159
if docTimeMin == math.MaxInt64 {

0 commit comments

Comments
 (0)