influxdata / influxdata/influxdb
SELECT * from /.*/ does not select string values
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
More precisely, it seems matching measurement name by regex returns string fields only if no other measurement with numerical fields also match.
I believe this is the root cause for #18132.
Steps to reproduce:
> create database playground
> use playground
Using database playground
> insert temperature,sensor=foo value=17.2
> insert temperature,sensor=foo value=14.6
> insert state,sensor=foo value="pending"
> insert state,sensor=foo value="complete"
> SELECT * from /.*/
Expected behavior:
name: temperature
time sensor value
---- ------ -----
1608201930629827407 foo 17.2
1608201942532968798 foo 14.6
name: state
time sensor value
---- ------ -----
1608201948581612466 foo pending
1608201954413360691 foo complete
Actual behavior:
Only temperature selected
name: temperature
time sensor value
---- ------ -----
1608201930629827407 foo 17.2
1608201942532968798 foo 14.6
Note that state can be selected without regex:
> SELECT * from state
name: state
time sensor value
---- ------ -----
1608201948581612466 foo pending
1608201954413360691 foo complete
or if it is the only match:
> SELECT * from /ate/
name: state
time sensor value
---- ------ -----
1608201948581612466 foo pending
1608201954413360691 foo complete
but not if temperature matches too:
> SELECT * from /te/
name: temperature
time sensor value
---- ------ -----
1608201930629827407 foo 17.2
1608201942532968798 foo 14.6
Looks like there's something fishy going on. This looks more like a bug than an intended behaviour.
Environment info:
- System info: Linux 4.19.0-13-cloud-amd64 x86_64
- InfluxDB version: InfluxDB v1.8.3 (git: 1.8 563e6c3d1a7a2790763c6289501095dbec19244e)
- Other relevant environment details: Container runtime, disk info, etc
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using the provided database, measurement, and SELECT commands, then trace regex measurement selection and field handling. Done means SELECT * from /.*/ returns both temperature and state, including the string values, with a regression test covering the mixed numeric and string measurements.
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
- Mostly clear
- Newbie friendliness
- 42/100