Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ A built-in function touches six modules. Each step names an example of that step
2. **Define it** in `BuiltInFunctionDefinitions` in `flink-table-common`: name, kind, input and output type strategies, and how it runs, see step 3.
- Write the name in upper case with underscores, such as `URL_DECODE`, so that SQL and the Table API use the same name.
- Reuse a strategy from `InputTypeStrategies`, `TypeStrategies`, `SpecificInputTypeStrategies` or `SpecificTypeStrategies` before writing a new one.
- When a new strategy would repeat code that other strategies share, extract a shared abstraction instead of copying it. `ValidationOnlyInputTypeStrategy` is one: for a function that declares its arguments with `staticArguments(...)`, it fixes the argument count and signature, so a subclass only implements `inferInputTypes` to validate. The strategies of `FROM_CHANGELOG`, `TO_CHANGELOG` and `DEDUPLICATE_KEEP_FIRST` use it.
- When a new strategy would repeat code that other strategies share, extract a shared abstraction instead of copying it. `ValidationOnlyInputTypeStrategy` is one: for a function that declares its arguments with `staticArguments(...)`, it fixes the argument count and signature, so a subclass only implements `inferInputTypes` to validate. The strategies of `FROM_CHANGELOG` and `TO_CHANGELOG` use it.
- Validate literal arguments in the input strategy, so that a malformed literal fails at planning time instead of on the first record.
- Register the function only here. Don't also add a field for it to `FlinkSqlOperatorTable`: that class registers every field by reflection, and a second operator with the same name makes compiled plans that call the function fail to restore.
- Every public class in `flink-table-common` and `flink-table-api-java`, nested classes included, needs a visibility annotation such as `@Internal`. ArchUnit checks this in `TableApiRules`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ The built-in process table functions (PTFs) take a table as input and return a t
| `FROM_CHANGELOG(input => TABLE t [, ...])` | Converts an append-only table with an explicit operation column into a dynamic table. See Changelog Conversion for the full list of arguments, semantics, and usage. |
| `TO_CHANGELOG(input => TABLE t [, ...])` | Converts a dynamic table into an append-only table with an explicit operation column. See Changelog Conversion for the full list of arguments, semantics, and usage. |
| `SNAPSHOT(input => TABLE t [, ...])` | Returns the current state of a dynamic table `t`. `SNAPSHOT` can only be used in a `LATERAL` context and not as a stand-alone table function. See [LATERAL SNAPSHOT join]({{< ref "docs/sql/reference/queries/joins" >}}#lateral-snapshot-join) for the full list of arguments, the join semantics, and usage. |
| `DEDUPLICATE_KEEP_FIRST(input => TABLE t [, ...])` | Keeps the first record per key as an append-only table (first arrival, or earliest event time with `on_time`). See [Deduplicate Keep First]({{< ref "docs/sql/reference/queries/deduplicate-keep-first" >}}#deduplicate_keep_first) for the full list of arguments, semantics, and usage. |
| `ML_PREDICT(TABLE t, MODEL m, DESCRIPTOR(...) [, ...])` | Applies the model `m` to the columns of table `t` that the `DESCRIPTOR` names, and returns the columns of `t` plus the prediction columns of the model. See [Model Inference]({{< ref "docs/sql/reference/queries/model-inference" >}}#ml_predict-函数) for the full list of arguments, semantics, and usage. |

Window table functions such as `TUMBLE` are listed under [Window]({{< ref "docs/sql/built-in-functions/window" >}}#window-table-functions). To implement your own PTF, see [Process Table Functions]({{< ref "docs/dev/table/functions/ptfs" >}}).
192 changes: 0 additions & 192 deletions docs/content.zh/docs/sql/reference/queries/deduplicate-keep-first.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ The built-in process table functions (PTFs) take a table as input and return a t
| `FROM_CHANGELOG(input => TABLE t [, ...])` | Converts an append-only table with an explicit operation column into a dynamic table. See [Changelog Conversion]({{< ref "docs/sql/reference/queries/changelog" >}}#from_changelog) for the full list of arguments, semantics, and usage. |
| `TO_CHANGELOG(input => TABLE t [, ...])` | Converts a dynamic table into an append-only table with an explicit operation column. See [Changelog Conversion]({{< ref "docs/sql/reference/queries/changelog" >}}#to_changelog) for the full list of arguments, semantics, and usage. |
| `SNAPSHOT(input => TABLE t [, ...])` | Returns the current state of a dynamic table `t`. `SNAPSHOT` can only be used in a `LATERAL` context and not as a stand-alone table function. See [LATERAL SNAPSHOT join]({{< ref "docs/sql/reference/queries/joins" >}}#lateral-snapshot-join) for the full list of arguments, the join semantics, and usage. |
| `DEDUPLICATE_KEEP_FIRST(input => TABLE t [, ...])` | Keeps the first record per key as an append-only table (first arrival, or earliest event time with `on_time`). See [Deduplicate Keep First]({{< ref "docs/sql/reference/queries/deduplicate-keep-first" >}}#deduplicate_keep_first) for the full list of arguments, semantics, and usage. |
| `ML_PREDICT(TABLE t, MODEL m, DESCRIPTOR(...) [, ...])` | Applies the model `m` to the columns of table `t` that the `DESCRIPTOR` names, and returns the columns of `t` plus the prediction columns of the model. See [Model Inference]({{< ref "docs/sql/reference/queries/model-inference" >}}#ml_predict-function) for the full list of arguments, semantics, and usage. |

Window table functions such as `TUMBLE` are listed under [Window]({{< ref "docs/sql/built-in-functions/window" >}}#window-table-functions). To implement your own PTF, see [Process Table Functions]({{< ref "docs/dev/table/functions/ptfs" >}}).
Loading