Skip to content

InfluxQL not pulling back distinct tag values #26321

Open
@peterbarnett03

Description

@peterbarnett03

Potential Bug

We're seeing an oddity in InfluxQL's ability to pull back distinct values in a tag. This is happening on InfluxDB 3 Enterprise.

Filing as a potential bug as this may just be a lack in my knowledge of how InfluxQL works and its relation to SQL in this space. I've worked with the user on different approaches but getting the same results; documentation and Claude-assistance didn't come to a useful solution. Filing across InfluxQL and v3/Enterprise.

Context

The below query works using SQL:

influxdb3 query --database influx_poc 'select distinct order_type from stats_v11 '

+------------+
| order_type |
+------------+
| A1         |
| A2         |
| P1         |
| I1         |
| S4         |
+------------+

But below query is not working using InfluxQL:

influxdb3 query --database influx_poc --language influxql 'show tag values from stats_v11 with key = "order_type"'

++
++

Additional Context

To show that the query I was doing for is a valid tag key, I was querying for "order_type" here.

influxdb3 query --database influx_poc --language influxql 'show tag keys from stats_v11 '

+------------------+---------------------------------+
| iox::measurement | tagKey                          |
+------------------+---------------------------------+
| stats_v11        | ....                            |
| stats_v11        | ....                            |
| stats_v11        | dist_from_avg_bucket            |
| stats_v11        | order_type                      |
| stats_v11        | venue                           |
| stats_v11        | ....                            |
| stats_v11        | ....                            |
+------------------+---------------------------------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions