influxdata / influxdata/influxdb
today() not working in query where statement (now() works ok)
- 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. use today in a query where (example: SELECT difference(last("value")) FROM "solar.grid.total.kwh" WHERE time >= today() GROUP BY time(1h) fill(0))
2. ...
3. ...
__Expected behavior:__
query works like when using now() in where statement
__Actual behavior:__
Error: Invalid operation: time and *influxql.Call are not compatible
__Environment info:__
* System info: Linux 5.4.0-77-generic x86_64
* InfluxDB version: InfluxDB v1.6.4 (git: unknown unknown)
__Config:__
Copy any non-default config values here or attach the full config as a gist or file.
__Logs:__
Include snippet of errors in log.
__Performance:__
Generate profiles with the following commands for bugs related to performance, locking, out of memory (OOM), etc.
```sh
# Commands should be run when the bug is actively happening.
# Note: This command will run for ~30 seconds.
curl -o profiles.tar.gz "http://localhost:8086/debug/pprof/all?cpu=30s"
iostat -xd 1 30 > iostat.txt
# Attach the `profiles.tar.gz` and `iostat.txt` output files.
```
Contributor guide
Research direction
Reproduce the example query against InfluxDB v1.6.4 and compare its handling of today() with now() in the WHERE clause. Trace the query-processing entry point that reports the incompatible time and influxql.Call error, then verify that the equivalent today() query executes successfully.
Written by the indexing model from the issue text.
Assessment
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100