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

Reparsing of Transformed Data Leading to Incorrect Results #154116

Open
Raventara opened this issue Mar 31, 2023 · 3 comments
Open

Reparsing of Transformed Data Leading to Incorrect Results #154116

Raventara opened this issue Mar 31, 2023 · 3 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Vega Vega visualizations impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure triage_needed

Comments

@Raventara
Copy link

Kibana version:
[6.8.23]

Vega Schema:
https://vega.github.io/schema/vega/v3.json

Elasticsearch version:
[6.8.23]

Server OS version:
Centos 5?

Browser version:
Firefox 111

Browser OS version:
Windows 11

Describe the bug:
When you refresh Kibana inside a certain timeframe it does not requery the data from ES, but it passes the already transformed data back through the vega spec, meaning any in-place calculations on fields are done on the already updated data. This only occurs on data that is retrieved from ES.

As a trivial example, simply take the cardinality of some value in an index and add some number to that count value:
{ "name": "countdata2", "url": { "index": "someindex", "body": {"aggs": {"count": {"cardinality": {"field": "name"}}}, "size": 0} }, "format": {"property": "aggregations.count"}, "transform": [{"type": "formula", "expr": "datum.value + 10", "as": "value"}] }

The first time this runs you get the expected result. X+10 = Y
If you refresh the kibana view in the correct time frame you will not see an API call to fetch the data again and you will end up with Y+10=Z
You can keep refreshing if you get the timing right and keep adding to the data.

However if you do the same thing based on a "values" set like
{ "name": "countdata1", "values": [{"value": 100}], "transform": [{"type": "formula", "expr": "datum.value + 10", "as": "value"}] }
You will only ever get 110. It will never change.

If you make transformations that perhaps check into the structure of your data and change that structure in place then you will actually end up with errors.
{ "type": "formula", "as": "somefield", "expr": "length(datum.somefield.buckets) == 0 ? [{'key':'none'}] : datum.somefield.buckets" }

All of these issues can be written around by ensuring that you never change some value in place but it's a PITA to have found this out so late in the game now and have to find all examples where data might end up misconstrued.

Expected behavior:
Either the ES data should be requeried each refresh, or the original ES data should be used and not the transformed data.

@Raventara Raventara added the bug Fixes for quality problems that affect the customer experience label Mar 31, 2023
@botelastic botelastic bot added the needs-team Issues missing a team label label Mar 31, 2023
@wayneseymour wayneseymour added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Mar 31, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Mar 31, 2023
@stratoula stratoula added triage_needed and removed bug Fixes for quality problems that affect the customer experience labels Mar 31, 2023
@stratoula
Copy link
Contributor

We need to evaluate if this happens to 7.17+ first, it might happen only in version 6 which is an old kibana version.

@Raventara
Copy link
Author

Raventara commented Apr 3, 2023

Possibly related to:
#122807

@dej611 dej611 added the Feature:Vega Vega visualizations label Apr 4, 2023
@drewdaemon drewdaemon added the impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. label Apr 6, 2023
@timductive timductive added bug Fixes for quality problems that affect the customer experience impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Vega Vega visualizations impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure triage_needed
Projects
None yet
Development

No branches or pull requests

7 participants