Skip to content

Commit

Permalink
[FLINK-14980][docs] add function ddl docs
Browse files Browse the repository at this point in the history
this closes apache#10732.
  • Loading branch information
HuangZhenQiu authored and bowenli86 committed Jan 2, 2020
1 parent 8830ef0 commit cac6b9d
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 4 deletions.
26 changes: 25 additions & 1 deletion docs/dev/table/sql/alter.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Flink SQL supports the following ALTER statements for now:

- ALTER TABLE
- ALTER DATABASE
- ALTER FUNCTION

## Run an ALTER statement

Expand Down Expand Up @@ -134,4 +135,27 @@ Set one or more properties in the specified table. If a particular property is a
ALTER DATABASE [catalog_name.]db_name SET (key1=val1, key2=val2, ...)
{% endhighlight %}

Set one or more properties in the specified database. If a particular property is already set in the database, override the old value with the new one.
Set one or more properties in the specified database. If a particular property is already set in the database, override the old value with the new one.

## ALTER FUNCTION

{% highlight sql%}
ALTER [TEMPORARY|TEMPORARY SYSTEM] FUNCTION
[IF EXISTS] [catalog_name.][db_name.]function_name
AS identifier [LANGUAGE JAVA|SCALA|
{% endhighlight %}

Alter a catalog function with the new identifier which is full classpath for JAVA/SCALA and optional language tag. If a function doesn't exist in the catalog, an exception is thrown.

**TEMPORARY**
Alter temporary catalog function that has catalog and database namespaces and overrides catalog functions.

**TEMPORARY SYSTEM**
Alter temporary system function that has no namespace and overrides built-in functions

**IF EXISTS**
If the function doesn't exist, nothing happens.

**LANGUAGE JAVA|SCALA**
Language tag to instruct flink runtime how to execute the function. Currently only JAVA and SCALA are supported, the default language for a function is JAVA.

26 changes: 25 additions & 1 deletion docs/dev/table/sql/alter.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Flink SQL supports the following ALTER statements for now:

- ALTER TABLE
- ALTER DATABASE
- ALTER FUNCTION

## Run an ALTER statement

Expand Down Expand Up @@ -134,4 +135,27 @@ Set one or more properties in the specified table. If a particular property is a
ALTER DATABASE [catalog_name.]db_name SET (key1=val1, key2=val2, ...)
{% endhighlight %}

Set one or more properties in the specified database. If a particular property is already set in the database, override the old value with the new one.
Set one or more properties in the specified database. If a particular property is already set in the database, override the old value with the new one.

## ALTER FUNCTION

{% highlight sql%}
ALTER [TEMPORARY|TEMPORARY SYSTEM] FUNCTION
[IF EXISTS] [catalog_name.][db_name.]function_name
AS identifier [LANGUAGE JAVA|SCALA|
{% endhighlight %}

Alter a catalog function that has catalog and database namespaces with the new identifier which is full classpath for JAVA/SCALA and optional language tag. If a function doesn't exist in the catalog, an exception is thrown.

**TEMPORARY**
Alter temporary catalog function that has catalog and database namespaces and overrides catalog functions.

**TEMPORARY SYSTEM**
Alter temporary system function that has no namespace and overrides built-in functions

**IF EXISTS**
If the function doesn't exist, nothing happens.

**LANGUAGE JAVA|SCALA**
Language tag to instruct flink runtime how to execute the function. Currently only JAVA and SCALA are supported, the default language for a function is JAVA.

22 changes: 22 additions & 0 deletions docs/dev/table/sql/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Flink SQL supports the following CREATE statements for now:

- CREATE TABLE
- CREATE DATABASE
- CREATE FUNCTION

## Run a CREATE statement

Expand Down Expand Up @@ -225,3 +226,24 @@ Database properties used to store extra information related to this database.
The key and value of expression `key1=val1` should both be string literal.

{% top %}

## CREATE FUNCTION
{% highlight sql%}
CREATE [TEMPORARY|TEMPORARY SYSTEM] FUNCTION
[IF NOT EXISTS] [catalog_name.][db_name.]function_name
AS identifier [LANGUAGE JAVA|SCALA]
{% endhighlight %}

Create a catalog function that has catalog and database namespaces with the identifier which is full classpath for JAVA/SCALA and optional language tag. If a function with the same name already exists in the catalog, an exception is thrown.

**TEMPORARY**
Create temporary catalog function that has catalog and database namespaces and overrides catalog functions.

**TEMPORARY SYSTEM**
Create temporary system function that has no namespace and overrides built-in functions

**IF NOT EXISTS**
If the function already exists, nothing happens.

**LANGUAGE JAVA|SCALA**
Language tag to instruct flink runtime how to execute the function. Currently only JAVA and SCALA are supported, the default language for a function is JAVA.
23 changes: 23 additions & 0 deletions docs/dev/table/sql/create.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Flink SQL supports the following CREATE statements for now:

- CREATE TABLE
- CREATE DATABASE
- CREATE FUNCTION

## Run a CREATE statement

Expand Down Expand Up @@ -225,3 +226,25 @@ Database properties used to store extra information related to this database.
The key and value of expression `key1=val1` should both be string literal.

{% top %}

## CREATE FUNCTION
{% highlight sql%}
CREATE [TEMPORARY|TEMPORARY SYSTEM] FUNCTION
[IF NOT EXISTS] [[catalog_name.]db_name.]function_name
AS identifier [LANGUAGE JAVA|SCALA]
{% endhighlight %}

Create a catalog function that has catalog and database namespaces with the identifier which is full classpath for JAVA/SCALA and optional language tag. If a function with the same name already exists in the catalog, an exception is thrown.

**TEMPORARY**
Create temporary catalog function that has catalog and database namespaces and overrides catalog functions.

**TEMPORARY SYSTEM**
Create temporary system function that has no namespace and overrides built-in functions

**IF NOT EXISTS**
If the function already exists, nothing happens.

**LANGUAGE JAVA|SCALA**
Language tag to instruct flink runtime how to execute the function. Currently only JAVA and SCALA are supported, the default language for a function is JAVA.

20 changes: 19 additions & 1 deletion docs/dev/table/sql/drop.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Flink SQL supports the following DROP statements for now:

- DROP TABLE
- DROP DATABASE
- DROP FUNCTION

## Run a DROP statement

Expand Down Expand Up @@ -140,4 +141,21 @@ Dropping a non-empty database triggers an exception. Enabled by default.

**CASCADE**

Dropping a non-empty database also drops all associated tables and functions.
Dropping a non-empty database also drops all associated tables and functions.

## DROP FUNCTION

{% highlight sql%}
DROP [TEMPORARY|TEMPORARY SYSTEM] FUNCTION [IF EXISTS] [catalog_name.][db_name.]function_name;
{% endhighlight %}

Drop a catalog function that has catalog and database namespaces. If the function to drop does not exist, an exception is thrown.

**TEMPORARY**
Drop temporary catalog function that has catalog and database namespaces.

**TEMPORARY SYSTEM**
Drop temporary system function that has no namespace.

**IF EXISTS**
If the function doesn't exists, nothing happens.
19 changes: 18 additions & 1 deletion docs/dev/table/sql/drop.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,21 @@ Dropping a non-empty database triggers an exception. Enabled by default.

**CASCADE**

Dropping a non-empty database also drops all associated tables and functions.
Dropping a non-empty database also drops all associated tables and functions.

## DROP FUNCTION

{% highlight sql%}
DROP [TEMPORARY|TEMPORARY SYSTEM] FUNCTION [IF EXISTS] [catalog_name.][db_name.]function_name;
{% endhighlight %}

Drop a catalog function that has catalog and database namespaces. If the function to drop does not exist, an exception is thrown.

**TEMPORARY**
Drop temporary catalog function that has catalog and database namespaces.

**TEMPORARY SYSTEM**
Drop temporary system function that has no namespace.

**IF EXISTS**
If the function doesn't exists, nothing happens.

0 comments on commit cac6b9d

Please sign in to comment.