-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Push down field extraction to time-series source #127445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
aa331a5
Push down field extraction to time-series source
dnhatn 7e510ae
naming
dnhatn 845c2d6
consistency
dnhatn 77af752
merge with stored-fields from loaders
dnhatn c034b2f
leftover
dnhatn 144f13d
oops
dnhatn 164d788
javadoc
dnhatn 558f5de
Merge remote-tracking branch 'elastic/main' into time-series-field-ex…
dnhatn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,7 +128,7 @@ static final class Impl extends SourceOperator { | |
| private LongVector.Builder timestampsBuilder; | ||
| private TsidBuilder tsHashesBuilder; | ||
| private SegmentsIterator iterator; | ||
| private final List<ValuesSourceReaderOperator.FieldInfo> fieldsToExact; | ||
| private final List<ValuesSourceReaderOperator.FieldInfo> fieldsToExtracts; | ||
| private ShardLevelFieldsReader fieldsReader; | ||
| private DocIdCollector docCollector; | ||
|
|
||
|
|
@@ -142,7 +142,7 @@ static final class Impl extends SourceOperator { | |
| ) { | ||
| this.maxPageSize = maxPageSize; | ||
| this.blockFactory = blockFactory; | ||
| this.fieldsToExact = fieldsToExtract; | ||
| this.fieldsToExtracts = fieldsToExtract; | ||
| this.emitDocIds = emitDocIds; | ||
| this.remainingDocs = limit; | ||
| this.timestampsBuilder = blockFactory.newLongVectorBuilder(Math.min(limit, maxPageSize)); | ||
|
|
@@ -172,7 +172,7 @@ public Page getOutput() { | |
| } | ||
|
|
||
| Page page = null; | ||
| Block[] blocks = new Block[(emitDocIds ? 3 : 2) + fieldsToExact.size()]; | ||
| Block[] blocks = new Block[(emitDocIds ? 3 : 2) + fieldsToExtracts.size()]; | ||
| try { | ||
| if (iterator == null) { | ||
| var slice = sliceQueue.nextSlice(); | ||
|
|
@@ -181,7 +181,7 @@ public Page getOutput() { | |
| return null; | ||
| } | ||
| Releasables.close(fieldsReader); | ||
| fieldsReader = new ShardLevelFieldsReader(blockFactory, slice.shardContext(), fieldsToExact); | ||
| fieldsReader = new ShardLevelFieldsReader(blockFactory, slice.shardContext(), fieldsToExtracts); | ||
| iterator = new SegmentsIterator(slice); | ||
| if (emitDocIds) { | ||
| docCollector = new DocIdCollector(blockFactory, slice.shardContext()); | ||
|
|
@@ -194,14 +194,14 @@ public Page getOutput() { | |
| iterator.readDocsForNextPage(); | ||
| if (currentPagePos > 0) { | ||
| int blockIndex = 0; | ||
| if (emitDocIds) { | ||
| if (docCollector != null) { | ||
| blocks[blockIndex++] = docCollector.build().asBlock(); | ||
| } | ||
| blocks[blockIndex++] = tsHashesBuilder.build().asBlock(); | ||
| tsHashesBuilder = new TsidBuilder(blockFactory, Math.min(remainingDocs, maxPageSize)); | ||
| blocks[blockIndex++] = timestampsBuilder.build().asBlock(); | ||
| timestampsBuilder = blockFactory.newLongVectorBuilder(Math.min(remainingDocs, maxPageSize)); | ||
| System.arraycopy(fieldsReader.buildBlocks(), 0, blocks, blockIndex, fieldsToExact.size()); | ||
| System.arraycopy(fieldsReader.buildBlocks(), 0, blocks, blockIndex, fieldsToExtracts.size()); | ||
| page = new Page(currentPagePos, blocks); | ||
| currentPagePos = 0; | ||
| } | ||
|
|
@@ -436,10 +436,12 @@ static final class ShardLevelFieldsReader implements Releasable { | |
| } | ||
| if (storedFieldsSpec.requiresSource()) { | ||
| sourceLoader = shardContext.newSourceLoader(); | ||
| storedFieldsSpec = storedFieldsSpec.merge(new StoredFieldsSpec(false, false, sourceLoader.requiredStoredFields())); | ||
| } else { | ||
| sourceLoader = null; | ||
| } | ||
| this.storedFieldsSpec = storedFieldsSpec; | ||
| ; | ||
|
||
| } | ||
|
|
||
| void readValues(int segment, int docID) throws IOException { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.