influxdata / influxdata/influxdb

SELECT * from /.*/ does not select string values

Open
#20,365 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

1.x
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.