ESQL: Support for _index metadata field in CsvTests#121261
Merged
GalLalouche merged 5 commits intoelastic:mainfrom Feb 2, 2025
Merged
ESQL: Support for _index metadata field in CsvTests#121261GalLalouche merged 5 commits intoelastic:mainfrom
GalLalouche merged 5 commits intoelastic:mainfrom
Conversation
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
idegtiarenko
approved these changes
Jan 30, 2025
bpintea
approved these changes
Jan 30, 2025
| private Block extractBlockForSingleDoc(DocBlock docBlock, String columnName, TestBlockCopier blockCopier) { | ||
| var indexId = docBlock.asVector().shards().getInt(0); | ||
| var indexPage = indexPages.get(indexId); | ||
| if (IndexResolver.INDEX_METADATA_FIELD.contains(columnName)) { |
Contributor
There was a problem hiding this comment.
The way IndexResolver.INDEX_METADATA_FIELD is defined is a bit trappy, since if that set is ever going to be extended, this might match too much. I guess that's defined as a set for convenience, but the name is then misleading. Don't know if it'd be worth it extracting the _index name into a constant (used in MetadataAttribute too) and matching exactly?
Anyways, can also be left as is.
Contributor
Author
There was a problem hiding this comment.
Done. I've defined the constant in MetadataAttribute.
ivancea
approved these changes
Jan 31, 2025
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
Outdated
Show resolved
Hide resolved
Collaborator
💔 Backport failed
You can use sqren/backport to manually backport by running |
GalLalouche
added a commit
to GalLalouche/elasticsearch
that referenced
this pull request
Feb 2, 2025
…1261) Manually cherry picking elastic#121261.
GalLalouche
added a commit
to GalLalouche/elasticsearch
that referenced
this pull request
Feb 3, 2025
…1261) Manually cherry picking elastic#121261.
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 3, 2025
GalLalouche
added a commit
to GalLalouche/elasticsearch
that referenced
this pull request
Feb 17, 2025
* ESQL: Support for _index metadata field in CsvTests * Extract INDEX constant to MetadataAttribute * Add comment on capability
GalLalouche
added a commit
to GalLalouche/elasticsearch
that referenced
this pull request
Feb 18, 2025
* ESQL: Support for _index metadata field in CsvTests * Extract INDEX constant to MetadataAttribute * Add comment on capability
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 18, 2025
#121261, #122607) (#122805) * ESQL: Support for _index metadata field in CsvTests (#121261) * ESQL: Support for _index metadata field in CsvTests * Extract INDEX constant to MetadataAttribute * Add comment on capability * ESQL: Initial support for unmapped fields (#119886) This PR adds initial support for unmapped fields, using the INSIST clause. For starters, this unmapped fields without a cast. Note that the INSIST keyword is potentially a placeholder, as the method of defining an unmapped field might change in the future, e.g., use a special magic function. As this is currently under development, the actual syntax is INSIST_🐔. First stage of #120072. Specifically, the following features are implemented in this PR: * Support for INSIST keyword without a cast. In particular, if the type being INSISTed upon is mapped to anything other than KEYWORD, it will result in an InvalidMappedField. There is no support for union type resolution on top of INSIST. Future PRs will handle these conflicts. There is support for multiple parameters, or INSIST on top of INSIST which is equivalent. * Enforcing that INSIST must always be on top of a FROM or another INSIST. While this may change in the future, e.g., handling cases like `FROM foo | EVAL x = 1 | INSIST bar` will not be done in this PR, as it makes handling INSIST too complicated.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds support for
METADATA _indexin our unit tests (CsvTests). To that end, I added a new, refined capability specifically for that field:index_metadata_field.