@@ -982,13 +982,9 @@ public void testOptionalColumnAtATimeReader() throws Exception {
982982 assertEquals (expectedGauge , actualGauge );
983983 }
984984 }
985-
986- // TODO add bulk loading to compressed values so this is not necessary
987- var block = (TestBlock ) binaryFixedDV .tryRead (factory , docs , 0 , random ().nextBoolean (), null , false );
988- if (isCompressed (config , binaryFixedField )) {
989- assertNull (block );
990- } else {
985+ {
991986 // bulk loading binary fixed length field:
987+ var block = (TestBlock ) binaryFixedDV .tryRead (factory , docs , 0 , random ().nextBoolean (), null , false );
992988 assertNotNull (block );
993989 assertEquals (size , block .size ());
994990 for (int j = 0 ; j < block .size (); j ++) {
@@ -997,13 +993,9 @@ public void testOptionalColumnAtATimeReader() throws Exception {
997993 assertEquals (expected , actual );
998994 }
999995 }
1000-
1001- // TODO add bulk loading to compressed values so this is not necessary
1002- block = (TestBlock ) binaryVariableDV .tryRead (factory , docs , 0 , random ().nextBoolean (), null , false );
1003- if (isCompressed (config , binaryVariableField )) {
1004- assertNull (block );
1005- } else {
996+ {
1006997 // bulk loading binary variable length field:
998+ var block = (TestBlock ) binaryVariableDV .tryRead (factory , docs , 0 , random ().nextBoolean (), null , false );
1007999 assertNotNull (block );
10081000 assertEquals (size , block .size ());
10091001 for (int j = 0 ; j < block .size (); j ++) {
@@ -1376,27 +1368,17 @@ public void testOptionalColumnAtATimeReaderWithSparseDocs() throws Exception {
13761368 {
13771369 var dv = getDenseBinaryValues (leafReader , binaryFixedField );
13781370 var block = (TestBlock ) dv .tryRead (factory , docs , 0 , random ().nextBoolean (), null , false );
1379- // TODO add bulk loading to compressed values so this is not necessary
1380- if (isCompressed (config , binaryFixedField )) {
1381- assertNull (block );
1382- } else {
1383- assertNotNull (block );
1384- for (int i = 0 ; i < testDocs .size (); i ++) {
1385- assertThat (block .get (i ), equalTo (binaryFixed [testDocs .get (i )]));
1386- }
1371+ assertNotNull (block );
1372+ for (int i = 0 ; i < testDocs .size (); i ++) {
1373+ assertThat (block .get (i ), equalTo (binaryFixed [testDocs .get (i )]));
13871374 }
13881375 }
13891376 {
13901377 var dv = getDenseBinaryValues (leafReader , binaryVariableField );
13911378 var block = (TestBlock ) dv .tryRead (factory , docs , 0 , random ().nextBoolean (), null , false );
1392- // TODO add bulk loading to compressed values so this is not necessary
1393- if (isCompressed (config , binaryVariableField )) {
1394- assertNull (block );
1395- } else {
1396- assertNotNull (block );
1397- for (int i = 0 ; i < testDocs .size (); i ++) {
1398- assertThat (block .get (i ), equalTo (binaryVariable [testDocs .get (i )]));
1399- }
1379+ assertNotNull (block );
1380+ for (int i = 0 ; i < testDocs .size (); i ++) {
1381+ assertThat (block .get (i ), equalTo (binaryVariable [testDocs .get (i )]));
14001382 }
14011383 }
14021384 }
@@ -1797,14 +1779,4 @@ public static BinaryDVCompressionMode randomBinaryCompressionMode() {
17971779 BinaryDVCompressionMode [] modes = BinaryDVCompressionMode .values ();
17981780 return modes [random ().nextInt (modes .length )];
17991781 }
1800-
1801- private boolean isCompressed (IndexWriterConfig config , String field ) {
1802- if (config .getCodec () instanceof Elasticsearch92Lucene103Codec codec ) {
1803- if (codec .getDocValuesFormatForField (field ) instanceof ES819TSDBDocValuesFormat format ) {
1804- return format .binaryDVCompressionMode != BinaryDVCompressionMode .NO_COMPRESS ;
1805- }
1806- }
1807- return false ;
1808- }
1809-
18101782}
0 commit comments