Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ private record IgnoredSourceRowStrideReader<T>(String fieldName, Reader<T> reade
public void read(int docId, StoredFields storedFields, Builder builder) throws IOException {
var ignoredSource = storedFields.storedFields().get(IgnoredSourceFieldMapper.NAME);
if (ignoredSource == null) {
builder.appendNull();
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

import static org.apache.lucene.tests.util.LuceneTestCase.newDirectory;
import static org.apache.lucene.tests.util.LuceneTestCase.random;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

public class BlockLoaderTestRunner {
private final BlockLoaderTestCase.Params params;
Expand Down Expand Up @@ -74,10 +76,9 @@ private Object load(BlockLoader blockLoader, LeafReaderContext context, MapperSe
// `columnAtATimeReader` is tried first, we mimic `ValuesSourceReaderOperator`
var columnAtATimeReader = blockLoader.columnAtATimeReader(context);
if (columnAtATimeReader != null) {
var block = (TestBlock) columnAtATimeReader.read(TestBlock.factory(context.reader().numDocs()), TestBlock.docs(0));
if (block.size() == 0) {
return null;
}
BlockLoader.Docs docs = TestBlock.docs(0);
var block = (TestBlock) columnAtATimeReader.read(TestBlock.factory(context.reader().numDocs()), docs);
assertThat(block.size(), equalTo(1));
return block.get(0);
}

Expand All @@ -99,9 +100,8 @@ private Object load(BlockLoader blockLoader, LeafReaderContext context, MapperSe
BlockLoader.Builder builder = blockLoader.builder(TestBlock.factory(context.reader().numDocs()), 1);
blockLoader.rowStrideReader(context).read(0, storedFieldsLoader, builder);
var block = (TestBlock) builder.build();
if (block.size() == 0) {
return null;
}
assertThat(block.size(), equalTo(1));

return block.get(0);
}

Expand Down