-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Initial support for unmapped fields #119886
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
GalLalouche
merged 69 commits into
elastic:main
from
GalLalouche:feature/unmapped_fields_squashed
Feb 13, 2025
Merged
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
fa3dd20
TEMP
GalLalouche c2b0d9c
WTF checkstyle?!
GalLalouche 7b33f15
Trying to fix failures
GalLalouche a105f0a
Add capability, Fix parser test
GalLalouche 0ca5e79
Update docs/changelog/119886.yaml
GalLalouche bf309fb
Update changelog
GalLalouche 0b72c89
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche c046112
Really merge main this time
GalLalouche aca3796
Merge branch 'main' into feature/unmapped_fields_squashed
craigtaverner dacc8f6
Craig's PR notes
GalLalouche f71a586
Test for no sources
GalLalouche 2ba5935
More code review fixes
GalLalouche c22b9d4
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche f5c77fa
Update docs/changelog/119886.yaml
GalLalouche d6afb24
More code review fixes
GalLalouche 25f0c53
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 165ad16
Merge branch 'feature/unmapped_fields_squashed' of github.com:GalLalo…
GalLalouche 9d85915
Some of Costin's notes
GalLalouche d0959ea
Pre huge refactor
GalLalouche d68a0ca
Post huge refactor
GalLalouche a12aa82
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche f02fd43
Temp fixes
GalLalouche a8d9372
Slighly more delicate refactor
GalLalouche fcd4663
Fix borken test
GalLalouche be4bbfd
Handle failing tests
GalLalouche b84ff2c
Fix test names
GalLalouche a0e1840
Replace flag with inheritance
GalLalouche 0b4132e
Add comment parsing
GalLalouche b05b327
Add a few more unmapped fields CSV tests
GalLalouche 3f9faef
Added IndexResolverFieldNames test
GalLalouche 903f6fa
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 85b84f5
Move tests from LogicalPlanOptimizerTests to AnalyzerTests
GalLalouche 400f473
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche fb09120
Properly apply Andrei's suggestion after it somehow got removed o_O
GalLalouche 0d9b280
Add snapshot check to StatementParserTests
GalLalouche d7ce623
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 0f01ebe
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 5c2c7d7
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche af26d5f
More code review fixes
GalLalouche faef67a
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 1204791
TEMP
GalLalouche 22569b8
Things pass! Excitement!
GalLalouche a9f4a0b
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 8f3c235
Remove println
GalLalouche 7d07d1a
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 697989c
Fix borken test
GalLalouche c0fe85e
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche ab9bfdf
More review fixes
GalLalouche 5c1c2be
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 9805f12
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche d5dc662
Fix borken test
GalLalouche ef56e8a
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 13b3dff
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 088a622
Try to fix BWC test
GalLalouche ea8567b
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 9c466e4
Try to fix BWC test (2)
GalLalouche 1fb5cb4
Try to fix BWC test (3)
GalLalouche 8017c78
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 4f6f6a1
Try to fix BWC test (4)
GalLalouche 971b869
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche ef94c52
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche c9fdc92
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche b46cb9d
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche b5da964
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 7a48277
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche dcc518c
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 770ea6f
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 97399fc
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche e32a446
Merge branch 'main' into feature/unmapped_fields_squashed
GalLalouche 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 119886 | ||
summary: Initial support for unmapped fields | ||
area: ES|QL | ||
type: feature | ||
issues: [] |
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
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
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
30 changes: 30 additions & 0 deletions
30
...c/main/java/org/elasticsearch/xpack/esql/core/type/PotentiallyUnmappedKeywordEsField.java
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
package org.elasticsearch.xpack.esql.core.type; | ||
|
||
import org.elasticsearch.common.io.stream.StreamInput; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* This class is used as a marker for fields that may be unmapped, where an unmapped field is a field which exists in the _source but is not | ||
* mapped in the index. Note that this field may be mapped for some indices, but is unmapped in at least one of them. | ||
* For indices where the field is unmapped, we will try to load them directly from _source. | ||
*/ | ||
public class PotentiallyUnmappedKeywordEsField extends KeywordEsField { | ||
public PotentiallyUnmappedKeywordEsField(String name) { | ||
super(name); | ||
} | ||
|
||
public PotentiallyUnmappedKeywordEsField(StreamInput in) throws IOException { | ||
super(in); | ||
} | ||
|
||
public String getWriteableName() { | ||
return "PotentiallyUnmappedKeywordEsField"; | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The field will be unmapped in at least one index hence its potential has been realized :) and the class can be simply called UnmappedKeywordEsField
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason it is "potentially" unmapped is that it might be mapped in some fields. I've added a comment to try to better explain this.