Merge branch 'master' into fix-get-started

pull/5827/head
Jason Stirnaman 2025-02-10 10:43:10 -06:00 committed by GitHub
commit f61a46be64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 95 additions and 5 deletions

View File

@ -0,0 +1,17 @@
---
title: SQL cache functions
list_title: Cache functions
description: >
Retrieve cached data from {{< product-name >}} caches.
menu:
influxdb3_core:
name: Cache
parent: sql-functions
weight: 311
source: /shared/sql-reference/functions/cache.md
---
<!--
The content for this page is at /content/shared/sql-reference/functions/cache.md
-->

View File

@ -0,0 +1,17 @@
---
title: SQL cache functions
list_title: Cache functions
description: >
Retrieve cached data from {{< product-name >}} caches.
menu:
influxdb3_enterprise:
name: Cache
parent: sql-functions
weight: 311
source: /shared/sql-reference/functions/cache.md
---
<!--
The content for this page is at /content/shared/sql-reference/functions/cache.md
-->

View File

@ -25,7 +25,7 @@ to
##### Schema
- home <em style="opacity: .5">(measurement)</em>
- home <em style="opacity: .5">(table)</em>
- **tags**:
- room
- Kitchen
@ -208,7 +208,7 @@ to
##### Schema
- home_actions <em style="opacity: .5">(measurement)</em>
- home_actions <em style="opacity: .5">(table)</em>
- **tags**:
- room
- Kitchen
@ -336,7 +336,7 @@ series use cases that involve seasonality.
##### Schema
- weather <em style="opacity: .5">(measurement)</em>
- weather <em style="opacity: .5">(table)</em>
- **tags**:
- location
- Concord
@ -430,7 +430,7 @@ The Bitcoin price sample dataset provides Bitcoin prices from
##### Schema
- bitcoin <em style="opacity: .5">(measurement)</em>
- bitcoin <em style="opacity: .5">(table)</em>
- **tags**:
- code
- EUR
@ -518,7 +518,7 @@ transformation functions.
##### Schema
- numbers <em style="opacity: .5">(measurement)</em>
- numbers <em style="opacity: .5">(table)</em>
- **fields**
- a <em style="opacity: .5">(float between -1 and 1)</em>
- b <em style="opacity: .5">(float between -3 and 3)</em>

View File

@ -0,0 +1,56 @@
The {{< product-name >}} SQL implementation supports the following functions
that return data from {{< product-name >}} caches.
- [distinct_cache](#distinct_cache)
- [last_cache](#last_cache)
## distinct_cache
Returns data from an {{< product-name >}} distinct value cache.
```sql
distinct_cache(table_name, cache_name)
```
#### Arguments
- **table_name**: Name of the table associated with the distinct value cache
_(formatted as a string literal)_.
- **datatype**: Name of the the distinct value cache to query
_(formatted as a string literal)_.
{{< expand-wrapper >}}
{{% expand "View `distinct_cache` query example" %}}
```sql
SELECT * FROM distinct_cache('example_table', 'exampleCacheName')
```
{{% /expand %}}
{{< /expand-wrapper >}}
## last_cache
Returns data from an {{< product-name >}} last value cache.
```sql
last_cache(table_name, cache_name)
```
#### Arguments
- **table_name**: Name of the table associated with the last value cache
_(formatted as a string literal)_.
- **datatype**: Name of the the last value cache to query
_(formatted as a string literal)_.
{{< expand-wrapper >}}
{{% expand "View `last_cache` query example" %}}
```sql
SELECT * FROM last_cache('example_table', 'exampleCacheName')
```
{{% /expand %}}
{{< /expand-wrapper >}}