| 46 | } |
| 47 | |
| 48 | func (b *BytesEncoder) writeTable(table vector.BytesTable) { |
| 49 | if len(b.bytes) == 0 { |
| 50 | val := table.Bytes(0) |
| 51 | b.min = append(b.min[:0], val...) |
| 52 | b.max = append(b.max[:0], val...) |
| 53 | } |
| 54 | for slot := range table.Len() { |
| 55 | val := table.Bytes(slot) |
| 56 | if bytes.Compare(val, b.min) < 0 { |
| 57 | b.min = append(b.min[:0], val...) |
| 58 | } |
| 59 | if bytes.Compare(val, b.max) > 0 { |
| 60 | b.max = append(b.max[:0], val...) |
| 61 | } |
| 62 | } |
| 63 | b.bytes = append(b.bytes, table.RawBytes()...) |
| 64 | b.offsets.write(table.RawOffsets()) |
| 65 | } |
| 66 | |
| 67 | func (b *BytesEncoder) Encode(group *errgroup.Group) { |
| 68 | group.Go(func() error { |