-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Use faster field caps #105067
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
elasticsearchmachine
merged 29 commits into
elastic:main
from
nik9000:faster_field_caps
Feb 27, 2024
Merged
ESQL: Use faster field caps #105067
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
63f5bf3
ESQL: Use faster field caps
nik9000 827e3d6
Update docs/changelog/105067.yaml
nik9000 1148dce
Precommit
nik9000 7b34c67
Merge remote-tracking branch 'refs/remotes/nik9000/faster_field_caps'…
nik9000 a6c12a9
Merge branch 'main' into faster_field_caps
nik9000 3dc6c45
WIP
nik9000 a609833
WIP
nik9000 f88319a
Finish porting
nik9000 e8bd7be
All
nik9000 0f147c5
Merge branch 'main' into faster_field_caps
nik9000 2e556fe
Merge branch 'main' into faster_field_caps
nik9000 037e646
Cleanup
nik9000 8be360f
More
nik9000 320f18b
Port more
nik9000 c6b35b5
Fix test
nik9000 093f9c7
More port
nik9000 6ae7208
More
nik9000 5cdd866
Merge branch 'main' into faster_field_caps
nik9000 3bdca55
Format!
nik9000 ab58335
One more
nik9000 96a13d5
Merge branch 'main' into faster_field_caps
nik9000 5d5b4be
More tests
nik9000 ae4cad8
Merge branch 'main' into faster_field_caps
nik9000 5a066ba
Closer
nik9000 1dd1c8d
Almost!
nik9000 8457072
Merge branch 'main' into faster_field_caps
nik9000 1719ba3
Merge branch 'main' into faster_field_caps
nik9000 5fe7cc0
Ski olds
nik9000 0e69134
Oh come on
nik9000 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: 105067 | ||
| summary: "ESQL: Use faster field caps" | ||
| area: ES|QL | ||
| type: enhancement | ||
| 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
26 changes: 26 additions & 0 deletions
26
...cluster/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/mixed/FieldExtractorIT.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,26 @@ | ||
| /* | ||
| * 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.qa.mixed; | ||
|
|
||
| import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters; | ||
|
|
||
| import org.elasticsearch.test.TestClustersThreadFilter; | ||
| import org.elasticsearch.test.cluster.ElasticsearchCluster; | ||
| import org.elasticsearch.xpack.esql.qa.rest.FieldExtractorTestCase; | ||
| import org.junit.ClassRule; | ||
|
|
||
| @ThreadLeakFilters(filters = TestClustersThreadFilter.class) | ||
| public class FieldExtractorIT extends FieldExtractorTestCase { | ||
| @ClassRule | ||
| public static ElasticsearchCluster cluster = Clusters.mixedVersionCluster(); | ||
|
|
||
| @Override | ||
| protected String getTestRestCluster() { | ||
| return cluster.getHttpAddresses(); | ||
| } | ||
| } |
22 changes: 22 additions & 0 deletions
22
...multi-node/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/multi_node/Clusters.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,22 @@ | ||
| /* | ||
| * 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.qa.multi_node; | ||
|
|
||
| import org.elasticsearch.test.cluster.ElasticsearchCluster; | ||
| import org.elasticsearch.test.cluster.local.distribution.DistributionType; | ||
|
|
||
| public class Clusters { | ||
| public static ElasticsearchCluster testCluster() { | ||
| return ElasticsearchCluster.local() | ||
| .distribution(DistributionType.DEFAULT) | ||
| .nodes(2) | ||
| .setting("xpack.security.enabled", "false") | ||
| .setting("xpack.license.self_generated.type", "trial") | ||
| .build(); | ||
| } | ||
| } |
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
26 changes: 26 additions & 0 deletions
26
...de/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/multi_node/FieldExtractorIT.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,26 @@ | ||
| /* | ||
| * 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.qa.multi_node; | ||
|
|
||
| import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters; | ||
|
|
||
| import org.elasticsearch.test.TestClustersThreadFilter; | ||
| import org.elasticsearch.test.cluster.ElasticsearchCluster; | ||
| import org.elasticsearch.xpack.esql.qa.rest.FieldExtractorTestCase; | ||
| import org.junit.ClassRule; | ||
|
|
||
| @ThreadLeakFilters(filters = TestClustersThreadFilter.class) | ||
| public class FieldExtractorIT extends FieldExtractorTestCase { | ||
| @ClassRule | ||
| public static ElasticsearchCluster cluster = Clusters.testCluster(); | ||
|
|
||
| @Override | ||
| protected String getTestRestCluster() { | ||
| return cluster.getHttpAddresses(); | ||
| } | ||
| } |
26 changes: 26 additions & 0 deletions
26
...e/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/FieldExtractorIT.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,26 @@ | ||
| /* | ||
| * 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.qa.single_node; | ||
|
|
||
| import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters; | ||
|
|
||
| import org.elasticsearch.test.TestClustersThreadFilter; | ||
| import org.elasticsearch.test.cluster.ElasticsearchCluster; | ||
| import org.elasticsearch.xpack.esql.qa.rest.FieldExtractorTestCase; | ||
| import org.junit.ClassRule; | ||
|
|
||
| @ThreadLeakFilters(filters = TestClustersThreadFilter.class) | ||
| public class FieldExtractorIT extends FieldExtractorTestCase { | ||
| @ClassRule | ||
| public static ElasticsearchCluster cluster = Clusters.testCluster(); | ||
|
|
||
| @Override | ||
| protected String getTestRestCluster() { | ||
| return cluster.getHttpAddresses(); | ||
| } | ||
| } |
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.
I'm not sure how this works, but I don't think it's a killer for the approach, but we should decide. This example makes it look like using two field types will give you the ambiguities error. But in other examples the QL index resolution stuff will give you the unsupported error. We could do either one on the ESQL side, but I picked doing the
unsupportederror because it's the first such error message I found. I'd be happy to switch it, but that'll break other tests which I'll have to coax back to grene.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.
These tests here are new (added with https://github.com/elastic/elasticsearch/pull/105544/files) because we didn't cover this in tests.
In any case, my personal opinion is that your approach is the better approach: tell the user early that there is field that's unsupported, rather than telling "these two fields have mixed incompatible types" and the user then trying to make them compatible (reindexing or whatever) and later to find out that the effort was in vain because the type they chose to make compatible is the wrong type.
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.
I'm glad you like it!