influxdata / influxdata/influxdb

mean() function asking for a field but I am passing field as mathematical operation but its not taking the value from the operation.

Open
#19,917 0 comments 0 reactions 0 assignees View on GitHub
area/influxql
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Steps to reproduce:__
List the minimal actions needed to reproduce the behavior.

1. ...SELECT round(mean(((x+y)/(x+z+y+w))*100)) FROM measurement_name WHERE time > now() - 2w AND time < now() - 1h GROUP BY time(1h)

__Expected behavior:__
This query should calculate the mean and round it off and show the result.
0 1411
1 25
2 11
3 3

__Actual behavior:__
Describe What actually happened.
ERR: expected field argument in mean()
__Environment info:__

* System info: Ubuntu 19.20
* InfluxDB version:1.8

**I tried breaking the whole big operation into small-small operation then perform the bigger operation but still, it's giving the error.**

SELECT round(z) FROM (SELECT (x+ y) as z FROM measurement_name WHERE time > now() - 15w AND time < now() - 1h GROUP BY time(1h))
__Expected behavior:__
0 2751
1 175
2 166
3 156
__Actual behavior:__
ERR: fill(none) must be used with a function

__Environment info:__

* System info: Ubuntu 19.20
* InfluxDB version:1.8

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported mean() query and the nested round() query against InfluxDB 1.8, using the expressions and time ranges in the issue. Compare the parser or query execution behavior with the expected results and the two reported errors. Done means both valid queries evaluate their expressions without requiring a field argument or producing the fill(none) error.

Written by the indexing model from the issue text.

Assessment

Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.