Skip to content
Merged
Changes from all 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
18 changes: 15 additions & 3 deletions content/en/ddsql_reference/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,6 @@
</table>





## Tags

DDSQL exposes tags as an `hstore` type, which is inspired by PostgreSQL. You can access the values for specific tag keys using the PostgreSQL arrow operator. For example:
Expand Down Expand Up @@ -840,6 +837,21 @@
ON da.tags = de.tags -- for a specific tag: da.tags->'app' = de.tags->'app'
```

Additionally, you can extract tag keys and values into individual arrays of text:

```sql
SELECT akeys(tags), avals(tags)
FROM aws.ec2_instance
```

### HSTORE functions and operators

Check warning on line 847 in content/en/ddsql_reference/_index.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.headings

'HSTORE functions and operators' should use sentence-style capitalization.

| Name | Return type | Description |
|-----------------------------------------------|---------------|---------------------------------------------------------------------------------------------------
| tags -> 'text' | Text | Gets the value for a given key. Returns `null` if key is not present. |
| akeys(hstore tags) | Array of text | Gets the keys of an HSTORE as an array |
| avals(hstore tags) | Array of text | Gets the values of an HSTORE as an array |

## Further reading

{{< partial name="whats-next/whats-next.html" >}}
Expand Down
Loading