Add 'last_cache' and 'distinct_cache' SQL functions (#5828)
* add last_value and distinct_value sql functions * fixed cache function namespull/5827/head^2
parent
a3f06ce722
commit
65faebb701
|
@ -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
|
||||
-->
|
|
@ -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
|
||||
-->
|
|
@ -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>
|
||||
|
|
|
@ -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 >}}
|
Loading…
Reference in New Issue