Skip to content
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

[ML] Anomaly detection jobs should allow missing values for geo fields #57300

Conversation

dimitris-athanasiou
Copy link
Contributor

Allows geo fields (geo_point, geo_shape) to have missing values.
Fixes a bug where such missing values would result in an error.

Closes #57299

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

Copy link
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

🔥🐛🔥

@@ -24,9 +24,13 @@ public GeoPointField(String name) {
@Override
public Object[] value(SearchHit hit) {
Object[] value = super.value(hit);
if (value.length != 1) {
if (value.length == 0) {
return new Object[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically it would save a memory allocation and garbage collection to just return value;. Maybe Hotspot will optimise this in practice.

Same in the other file.

Allows geo fields (`geo_point`, `geo_shape`) to have missing values.
Fixes a bug where such missing values would result in an error.

Closes elastic#57299
@dimitris-athanasiou dimitris-athanasiou force-pushed the anomaly-detection-should-allow-missing-values-for-geo-fields branch from 31296ca to 50ff241 Compare May 28, 2020 17:43
@dimitris-athanasiou dimitris-athanasiou merged commit d26f63d into elastic:master May 29, 2020
@dimitris-athanasiou dimitris-athanasiou deleted the anomaly-detection-should-allow-missing-values-for-geo-fields branch May 29, 2020 08:28
dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this pull request May 29, 2020
…fields (elastic#57300)

Allows geo fields (`geo_point`, `geo_shape`) to have missing values.
Fixes a bug where such missing values would result in an error.

Closes elastic#57299

Backport of elastic#57300
dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this pull request May 29, 2020
…fields (elastic#57300)

Allows geo fields (`geo_point`, `geo_shape`) to have missing values.
Fixes a bug where such missing values would result in an error.

Closes elastic#57299

Backport of elastic#57300
dimitris-athanasiou added a commit that referenced this pull request May 29, 2020
…fields (#57300) (#57338)

Allows geo fields (`geo_point`, `geo_shape`) to have missing values.
Fixes a bug where such missing values would result in an error.

Closes #57299

Backport of #57300
dimitris-athanasiou added a commit that referenced this pull request May 29, 2020
…fields (#57300) (#57339)

Allows geo fields (`geo_point`, `geo_shape`) to have missing values.
Fixes a bug where such missing values would result in an error.

Closes #57299

Backport of #57300
dimitris-athanasiou added a commit that referenced this pull request May 29, 2020
…fields (#57300) (#57341)

Allows geo fields (`geo_point`, `geo_shape`) to have missing values.
Fixes a bug where such missing values would result in an error.

Closes #57299

Backport of #57300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] lat_long should be more tolerant to missing data
5 participants