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

Comparison between integer and float should work #15055

Closed
affo opened this issue Sep 9, 2019 · 3 comments
Closed

Comparison between integer and float should work #15055

affo opened this issue Sep 9, 2019 · 3 comments

Comments

@affo
Copy link
Contributor

affo commented Sep 9, 2019

A pushed down filter transformation in Flux returned no values because it was comparing double with an integer.

That comparison should work.

Line protocol data:

temperature,sensor=S1 value=30 1567512280951
smoke,sensor=S1 value=false 1567512280951
temperature,sensor=S1 value=40 1567512340951
smoke,sensor=S1 value=true 1567512340951
temperature,sensor=S1 value=55 1567512400951
smoke,sensor=S1 value=true 1567512400951
temperature,sensor=S1 value=55 1567512460951
smoke,sensor=S1 value=true 1567512460951
temperature,sensor=S1 value=55 1567512520951
smoke,sensor=S1 value=true 1567512520951

No data from this query:

from(bucket: "training")
  |> range(start: 2019-09-03T12:00:00Z, stop: 2019-09-03T12:10:00Z)
  |> filter(fn: (r) => r._measurement == "temperature")
  |> filter(fn: (r) => r.sensor == "S1")
  |> filter(fn: (r) => r._value > 50)

Data from this one:

from(bucket: "training")
  |> range(start: 2019-09-03T12:00:00Z, stop: 2019-09-03T12:10:00Z)
  |> filter(fn: (r) => r._measurement == "temperature")
  |> filter(fn: (r) => r._field == "value")
  |> filter(fn: (r) => r.sensor == "S1")
  |> filter(fn: (r) => r._value > float(v:50))

This should be a bug in InfluxDB, because that filter is pushed down to storage by Flux.

@stale
Copy link

stale bot commented Dec 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 8, 2019
@affo
Copy link
Contributor Author

affo commented Dec 9, 2019

I think this is still relevant

@stale stale bot removed the wontfix label Dec 9, 2019
@russorat
Copy link
Contributor

this should be solved when this epic is closed. please follow it for updates. influxdata/flux#3348

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

No branches or pull requests

2 participants