Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions content/enterprise_influxdb/v1/query_language/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ InfluxQL supports using regular expressions when specifying:
> non-string field values in the
> `WHERE` clause,
> [databases](/enterprise_influxdb/v1/concepts/glossary/#database), and
> [retention polices](/enterprise_influxdb/v1/concepts/glossary/#retention-policy-rp).
> [retention policies](/enterprise_influxdb/v1/concepts/glossary/#retention-policy-rp).

## Queries

Expand Down Expand Up @@ -1155,7 +1155,7 @@ SHOW TAG KEY EXACT CARDINALITY
### SHOW TAG KEYS

```
show_tag_keys_stmt = "SHOW TAG KEYS" [on_clause] [with_key_clause] [ from_clause ] [ where_clause ]
show_tag_keys_stmt = "SHOW TAG KEYS" [on_clause] [with_tag_clause] [ from_clause ] [ where_clause ]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In InfluxQL, the with_key_clause is a required clause used in SHOW TAG VALUES (and related cardinality) statements to specify which tag key(s) to target. Its syntax is defined as:

with_tag_clause = "WITH KEY" ( "=" tag_key | "!=" tag_key | "=~" regex_lit | "IN (" tag_keys ")" )

[InfluxQL spec]

It supports the following operators:

  • = — equal to a specific tag key
  • != — not equal to a specific tag key
  • =~ — matches a regular expression
  • IN (...) — matches any of a list of tag keys

Examples

-- Show all tag values for the "region" tag key
SHOW TAG VALUES WITH KEY = "region"

-- Show tag values for region & host tag keys where service = 'redis'
SHOW TAG VALUES FROM "cpu" WITH KEY IN ("region", "host") WHERE "service" = 'redis'

-- Show tag values for all tag keys that do NOT include the letter "c"
SHOW TAG VALUES WITH KEY !~ /.*c.*/

[SHOW TAG VALUES]

The WITH KEY clause is required for SHOW TAG VALUES queries — without it, the query is invalid. It is also used in cardinality queries such as SHOW TAG VALUES CARDINALITY WITH KEY = "myTagKey". [InfluxQL spec]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec already defines with_tag_clause with exactly that WITH KEY (...) syntax (line 1274 in the enterprise spec). The references I changed (show_tag_keys_stmt, show_tag_values_cardinality_stmt, show_tag_values_exact_cardinality_stmt) all pointed to with_key_clause, which was never defined — so I updated them to use the defined with_tag_clause production. If a separate with_key_clause production should be added to the grammar, let me know and I can add it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot revert your clause changes and create a separate issue to research and test them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in bcb1d78. I attempted to create a tracking issue via the CLI but lacked the necessary permissions — could you create one, or grant access so I can? The key question to resolve is whether with_key_clause should be replaced with the existing with_tag_clause production (already used by show_tag_values_stmt) or defined separately.

[ limit_clause ] [ offset_clause ] .
```

Expand Down Expand Up @@ -1211,9 +1211,9 @@ Estimates or counts exactly the cardinality of tag key values for the specified
> Filtering by `time` is only supported when TSI (Time Series Index) is enabled.

```
show_tag_values_cardinality_stmt = "SHOW TAG VALUES CARDINALITY" [ on_clause ] [ from_clause ] [ where_clause ] [ group_by_clause ] [ limit_clause ] [ offset_clause ] with_key_clause
show_tag_values_cardinality_stmt = "SHOW TAG VALUES CARDINALITY" [ on_clause ] [ from_clause ] [ where_clause ] [ group_by_clause ] [ limit_clause ] [ offset_clause ] with_tag_clause

show_tag_values_exact_cardinality_stmt = "SHOW TAG VALUES EXACT CARDINALITY" [ on_clause ] [ from_clause ] [ where_clause ] [ group_by_clause ] [ limit_clause ] [ offset_clause ] with_key_clause
show_tag_values_exact_cardinality_stmt = "SHOW TAG VALUES EXACT CARDINALITY" [ on_clause ] [ from_clause ] [ where_clause ] [ group_by_clause ] [ limit_clause ] [ offset_clause ] with_tag_clause
```

#### Examples
Expand Down
2 changes: 1 addition & 1 deletion content/enterprise_influxdb/v1/tools/influxd-ctl/backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ influxd-ctl backup -shard 00 /path/to/backup-dir
The following example uses the fastest possible compression speeds for backup:

```sh
influxd-ctl backup -strategy full -gzipBlockSize 10485760 -gzipBlockCount 28 -gzipCompressionLevel none .
influxd-ctl backup -strategy full -gzipCompressionLevel none .
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this. The introductory sentence explains why these values are used.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in e6ec17e.

```
10 changes: 5 additions & 5 deletions content/influxdb/v1/query_language/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ InfluxQL supports using regular expressions when specifying:
> non-string field values in the
> `WHERE` clause,
> [databases](/influxdb/v1/concepts/glossary/#database), and
> [retention polices](/influxdb/v1/concepts/glossary/#retention-policy-rp).
> [retention policies](/influxdb/v1/concepts/glossary/#retention-policy-rp).

## Queries

Expand Down Expand Up @@ -755,7 +755,7 @@ GRANT READ ON "mydb" TO "jdoe"
Stop a currently-running query.

```sql
KILL QUERY <qid>
KILL QUERY <query_id>
```

```
Expand Down Expand Up @@ -1149,7 +1149,7 @@ SHOW TAG KEY EXACT CARDINALITY
### SHOW TAG KEYS

```
show_tag_keys_stmt = "SHOW TAG KEYS" [on_clause] [with_key_clause] [ from_clause ] [ where_clause ]
show_tag_keys_stmt = "SHOW TAG KEYS" [on_clause] [with_tag_clause] [ from_clause ] [ where_clause ]
[ limit_clause ] [ offset_clause ] .
```

Expand Down Expand Up @@ -1205,9 +1205,9 @@ Estimates or counts exactly the cardinality of tag key values for the specified
> Filtering by `time` is only supported when TSI (Time Series Index) is enabled.

```
show_tag_values_cardinality_stmt = "SHOW TAG VALUES CARDINALITY" [ on_clause ] [ from_clause ] [ where_clause ] [ group_by_clause ] [ limit_clause ] [ offset_clause ] with_key_clause
show_tag_values_cardinality_stmt = "SHOW TAG VALUES CARDINALITY" [ on_clause ] [ from_clause ] [ where_clause ] [ group_by_clause ] [ limit_clause ] [ offset_clause ] with_tag_clause

show_tag_values_exact_cardinality_stmt = "SHOW TAG VALUES EXACT CARDINALITY" [ on_clause ] [ from_clause ] [ where_clause ] [ group_by_clause ] [ limit_clause ] [ offset_clause ] with_key_clause
show_tag_values_exact_cardinality_stmt = "SHOW TAG VALUES EXACT CARDINALITY" [ on_clause ] [ from_clause ] [ where_clause ] [ group_by_clause ] [ limit_clause ] [ offset_clause ] with_tag_clause
```

#### Examples
Expand Down