-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Support for _index metadata field in CsvTests #121261
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
ESQL: Support for _index metadata field in CsvTests #121261
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
| 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)) { |
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 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.
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.
Done. I've defined the constant in MetadataAttribute.
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
Outdated
Show resolved
Hide resolved
💔 Backport failed
You can use sqren/backport to manually backport by running |
…1261) Manually cherry picking elastic#121261.
…1261) Manually cherry picking elastic#121261.
* ESQL: Support for _index metadata field in CsvTests * Extract INDEX constant to MetadataAttribute * Add comment on capability
* ESQL: Support for _index metadata field in CsvTests * Extract INDEX constant to MetadataAttribute * Add comment on capability
#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 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.