influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
29.05k stars 3.56k forks source link

query doesn't return result / returns partial result, when there is change in datatype of a field in that time range. #24938

Open faiz-hcs opened 7 months ago

faiz-hcs commented 7 months ago

Steps to reproduce:

  1. Need a bucket where there is a change in datatype of a field.
  2. Run Query for the time-range which will consist of data where datatype of field has changed.

Expected behaviour:

  1. The query should return all of the data available in the specified time range.

Actual behaviour:

  1. The query returns either no data, or partial data.
    • Query returns No data. Screenshot No data
    • Query returns data & data type is int (time range is subset of above time range) Screenshot datatype integer
    • Datatype is string (screenshot also shows partial data returned , as this time range has more data as can be seen in above screenshot) Screenshot_string_datatype

Link to issue on Influx forum : https://community.influxdata.com/t/flux-query-does-not-return-results-if-wider-time-range-is-selected/33750/9

Environment info:

Note: Upgrading to the latest version didn't fix the issue

docker run --name influxdb -d -p 8086:8086 --volume c:\projects\test_influxdata_3:/var/lib/influxdb2 --volume c:\projects\test_influxdata_3\config:/etc/influxdb2 influxdb:2.7.1 

Config: Default config.

Logs: No error messages in the Logs as well as flux query logs.

latonita commented 7 months ago

I had same problem with v2.6.1. There was integer/double type change of value field which was unnoticed. The only workaround was to export data, clean table and import it back.

faiz-hcs commented 7 months ago

I had same problem with v2.6.1. There was integer/double type change of value field which was unnoticed. The only workaround was to export data, clean table and import it back.

Hi @latonita How did you exactly clean the data? and also how did you export and import it ?

latonita commented 7 months ago

@faiz-hcs I was using influxdb ui. I have identified few records with wrong data type, just saved those values on a paper and deleted it from the DB with CLI, then I made a query in Data Explorer which returns all the data and saved to csv with 'save to csv' :) button then added missing records to CSV file then uploaded CSV with "Load data" section

zLvkas commented 3 months ago

Hey,

are there any news about this topic?