@@ -208,6 +208,26 @@ public BytesRef binaryValue() throws IOException {
208
208
bytesSlice .readBytes ((long ) doc * length , bytes .bytes , 0 , length );
209
209
return bytes ;
210
210
}
211
+
212
+ @ Override
213
+ public BlockLoader .Block tryRead (
214
+ BlockLoader .BlockFactory factory ,
215
+ BlockLoader .Docs docs ,
216
+ int offset ,
217
+ boolean nullsFiltered ,
218
+ BlockDocValuesReader .ToDouble toDouble ,
219
+ boolean toInt
220
+ ) throws IOException {
221
+ int count = docs .count () - offset ;
222
+ try (var builder = factory .bytesRefs (count )) {
223
+ for (int i = offset ; i < docs .count (); i ++) {
224
+ doc = docs .get (i );
225
+ bytesSlice .readBytes ((long ) doc * length , bytes .bytes , 0 , length );
226
+ builder .appendBytesRef (bytes );
227
+ }
228
+ return builder .build ();
229
+ }
230
+ }
211
231
};
212
232
} else {
213
233
// variable length
@@ -223,6 +243,28 @@ public BytesRef binaryValue() throws IOException {
223
243
bytesSlice .readBytes (startOffset , bytes .bytes , 0 , bytes .length );
224
244
return bytes ;
225
245
}
246
+
247
+ @ Override
248
+ public BlockLoader .Block tryRead (
249
+ BlockLoader .BlockFactory factory ,
250
+ BlockLoader .Docs docs ,
251
+ int offset ,
252
+ boolean nullsFiltered ,
253
+ BlockDocValuesReader .ToDouble toDouble ,
254
+ boolean toInt
255
+ ) throws IOException {
256
+ int count = docs .count () - offset ;
257
+ try (var builder = factory .bytesRefs (count )) {
258
+ for (int i = offset ; i < docs .count (); i ++) {
259
+ doc = docs .get (i );
260
+ long startOffset = addresses .get (doc );
261
+ bytes .length = (int ) (addresses .get (doc + 1L ) - startOffset );
262
+ bytesSlice .readBytes (startOffset , bytes .bytes , 0 , bytes .length );
263
+ builder .appendBytesRef (bytes );
264
+ }
265
+ return builder .build ();
266
+ }
267
+ }
226
268
};
227
269
}
228
270
} else {
@@ -267,7 +309,7 @@ public BytesRef binaryValue() throws IOException {
267
309
}
268
310
}
269
311
270
- private abstract static class DenseBinaryDocValues extends BinaryDocValues {
312
+ private abstract static class DenseBinaryDocValues extends BinaryDocValues implements BlockLoader . OptionalColumnAtATimeReader {
271
313
272
314
final int maxDoc ;
273
315
int doc = -1 ;
0 commit comments