Unverified Commit fbf46ae5 authored by Licho's avatar Licho Committed by GitHub

doc: add watch table and create temporal function (#1848)

Signed-off-by: 's avatarLicho <lecho.sun@gmail.com>
parent 49fbafb8
---
sidebar_position:
id: create_temporal_function
title: CREATE TEMPORAL FUNCTION
---
CREATE TEMPORAL FUNCTION 实现在sql中定义[Defining a Temporal Table Function](https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/dev/table/concepts/temporal_table_function/#defining-a-temporal-table-function:~:text=pure%20SQL%20DDL.-,Defining%20a%20Temporal%20Table%20Function,-%23)
功能,语法结构如下:
```sql
CREATE TEMPORAL [TEMPORARY|TEMPORARY SYSTEM] FUNCTION
[IF NOT EXISTS] [catalog_name.][db_name.]function_name
AS SELECT update_time, target FROM tableName
```
其中`update_time`列为版本时间属性列,`target` 是一个或多个键值列, `talbeName`表示版本表名。
```sql
create temporal temporary function
IF NOT EXISTS rates
as select update_time, currency from currency_rates;
```
该语句等价table API示例:
```java
TemporalTableFunction rates = tEnv
.from("currency_rates")
.createTemporalTableFunction("update_time", "currency");
tEnv.createTemporarySystemFunction("rates", rates);
```
---
sidebar_position: 5
id: watch_table
title: WATCH TABLE
---
WATCH TABLE 实现埋点功能, 可实现在dinky->表数据标签页动态查看运行时各表数据实时内容,语法结构如下:
```sql
WATCH tableName
```
表可以是source/view, 但不可以是sink表。
```sql
watch Orders;
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment