Can I use the syntax below? Or is it a bug?
I use the sample data NOAA_water_database from the influxdb doc.
I found that data(“location=santa_monica” , “fill(linear)”, order by time desc) is not correct. Data with time range from ‘2015-08-17T23:00:00Z’ to ‘2015-08-18T00:00:00Z’ should be null because the raw data with the same time range is null.
But data with with “location=coyote_creek” and “fill(linear)” is correct.
And all are correct if I remove the [ORDER_BY_clause].
Influxdb version 1.2
SELECT_clause [INTO_clause] FROM_clause [WHERE_clause] GROUP BY *[,time(<time_interval>)] fill(xxx) [ORDER_BY_clause] SLIMIT N
> SELECT MEAN("water_level") FROM "h2o_feet" WHERE time >= '2015-08-17T23:00:00Z' AND time <= '2015-08-18T00:42:00Z' GROUP BY *,time(6m) ORDER BY time DESC SLIMIT 2
name: h2o_feet
tags: location=santa_monica
time mean
---- ----
2015-08-18T00:42:00Z 2.057
2015-08-18T00:36:00Z 2.067
2015-08-18T00:30:00Z 2.051
2015-08-18T00:24:00Z 2.041
2015-08-18T00:18:00Z 2.126
2015-08-18T00:12:00Z 2.028
2015-08-18T00:06:00Z 2.116
2015-08-18T00:00:00Z 2.064
2015-08-17T23:54:00Z
2015-08-17T23:48:00Z
2015-08-17T23:42:00Z
2015-08-17T23:36:00Z
2015-08-17T23:30:00Z
2015-08-17T23:24:00Z
2015-08-17T23:18:00Z
2015-08-17T23:12:00Z
2015-08-17T23:06:00Z
2015-08-17T23:00:00Z
name: h2o_feet
tags: location=coyote_creek
time mean
---- ----
2015-08-18T00:42:00Z 7.234
2015-08-18T00:36:00Z 7.372
2015-08-18T00:30:00Z 7.5
2015-08-18T00:24:00Z 7.635
2015-08-18T00:18:00Z 7.762
2015-08-18T00:12:00Z 7.887
2015-08-18T00:06:00Z 8.005
2015-08-18T00:00:00Z 8.12
2015-08-17T23:54:00Z
2015-08-17T23:48:00Z
2015-08-17T23:42:00Z
2015-08-17T23:36:00Z
2015-08-17T23:30:00Z
2015-08-17T23:24:00Z
2015-08-17T23:18:00Z
2015-08-17T23:12:00Z
2015-08-17T23:06:00Z
2015-08-17T23:00:00Z
>SELECT MEAN("water_level") FROM "h2o_feet" WHERE time >= '2015-08-17T23:00:00Z' AND time <= '2015-08-18T00:42:00Z' GROUP BY *,time(6m) fill(linear) ORDER BY time DESC SLIMIT 2
name: h2o_feet
tags: location=santa_monica
time mean
---- ----
2015-08-18T00:42:00Z 2.057
2015-08-18T00:36:00Z 2.067
2015-08-18T00:30:00Z 2.051
2015-08-18T00:24:00Z 2.041
2015-08-18T00:18:00Z 2.126
2015-08-18T00:12:00Z 2.028
2015-08-18T00:06:00Z 2.116
2015-08-18T00:00:00Z 2.064
2015-08-17T23:54:00Z 1.3254285714285716
2015-08-17T23:48:00Z 0.586857142857143
2015-08-17T23:42:00Z -0.1517142857142857
2015-08-17T23:36:00Z -0.8902857142857141
2015-08-17T23:30:00Z -1.6288571428571426
2015-08-17T23:24:00Z -2.3674285714285714
2015-08-17T23:18:00Z -3.106
2015-08-17T23:12:00Z -3.8445714285714283
2015-08-17T23:06:00Z -4.583142857142857
2015-08-17T23:00:00Z -5.321714285714285
name: h2o_feet
tags: location=coyote_creek
time mean
---- ----
2015-08-18T00:42:00Z 7.234
2015-08-18T00:36:00Z 7.372
2015-08-18T00:30:00Z 7.5
2015-08-18T00:24:00Z 7.635
2015-08-18T00:18:00Z 7.762
2015-08-18T00:12:00Z 7.887
2015-08-18T00:06:00Z 8.005
2015-08-18T00:00:00Z 8.12
2015-08-17T23:54:00Z
2015-08-17T23:48:00Z
2015-08-17T23:42:00Z
2015-08-17T23:36:00Z
2015-08-17T23:30:00Z
2015-08-17T23:24:00Z
2015-08-17T23:18:00Z
2015-08-17T23:12:00Z
2015-08-17T23:06:00Z
2015-08-17T23:00:00Z
> SELECT MEAN("water_level") FROM "h2o_feet" WHERE time >= '2015-08-17T23:00:00Z' AND time <= '2015-08-18T00:42:00Z' GROUP BY *,time(6m) fill(linear) SLIMIT 2
name: h2o_feet
tags: location=coyote_creek
time mean
---- ----
2015-08-17T23:00:00Z
2015-08-17T23:06:00Z
2015-08-17T23:12:00Z
2015-08-17T23:18:00Z
2015-08-17T23:24:00Z
2015-08-17T23:30:00Z
2015-08-17T23:36:00Z
2015-08-17T23:42:00Z
2015-08-17T23:48:00Z
2015-08-17T23:54:00Z
2015-08-18T00:00:00Z 8.12
2015-08-18T00:06:00Z 8.005
2015-08-18T00:12:00Z 7.887
2015-08-18T00:18:00Z 7.762
2015-08-18T00:24:00Z 7.635
2015-08-18T00:30:00Z 7.5
2015-08-18T00:36:00Z 7.372
2015-08-18T00:42:00Z 7.234
name: h2o_feet
tags: location=santa_monica
time mean
---- ----
2015-08-17T23:00:00Z
2015-08-17T23:06:00Z
2015-08-17T23:12:00Z
2015-08-17T23:18:00Z
2015-08-17T23:24:00Z
2015-08-17T23:30:00Z
2015-08-17T23:36:00Z
2015-08-17T23:42:00Z
2015-08-17T23:48:00Z
2015-08-17T23:54:00Z
2015-08-18T00:00:00Z 2.064
2015-08-18T00:06:00Z 2.116
2015-08-18T00:12:00Z 2.028
2015-08-18T00:18:00Z 2.126
2015-08-18T00:24:00Z 2.041
2015-08-18T00:30:00Z 2.051
2015-08-18T00:36:00Z 2.067
2015-08-18T00:42:00Z 2.057