You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ja...@apache.org on 2022/09/20 01:45:28 UTC

[flink] 16/25: [FLINK-29025][docs] add drop page for Hive dialect

This is an automated email from the ASF dual-hosted git repository.

jark pushed a commit to branch release-1.16
in repository https://gitbox.apache.org/repos/asf/flink.git

commit dffad01bf356cc01411e31fb17dc3bb7726893f4
Author: luoyuxia <lu...@alumni.sjtu.edu.cn>
AuthorDate: Mon Aug 29 15:39:05 2022 +0800

    [FLINK-29025][docs] add drop page for Hive dialect
---
 .../table/hiveCompatibility/hiveDialect/drop.md    | 146 +++++++++++++++++++++
 .../table/hiveCompatibility/hiveDialect/drop.md    | 146 +++++++++++++++++++++
 2 files changed, 292 insertions(+)

diff --git a/docs/content.zh/docs/dev/table/hiveCompatibility/hiveDialect/drop.md b/docs/content.zh/docs/dev/table/hiveCompatibility/hiveDialect/drop.md
new file mode 100644
index 00000000000..67bca77e1d7
--- /dev/null
+++ b/docs/content.zh/docs/dev/table/hiveCompatibility/hiveDialect/drop.md
@@ -0,0 +1,146 @@
+---
+title: "DROP Statements"
+weight: 2
+type: docs
+aliases:
+- /dev/table/hiveCompatibility/hiveDialect/create.html
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+  http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# CREATE Statements
+
+With Hive dialect, the following DROP statements are supported for now:
+
+- DROP DATABASE
+- DROP TABLE
+- DROP VIEW
+- DROP MARCO
+- DROP FUNCTION
+
+## DROP DATABASE
+
+### Description
+
+`DROP DATABASE` statement is used to drop a database as well as the tables/directories associated with the database.
+
+### Syntax
+
+```sql
+DROP (DATABASE|SCHEMA) [IF EXISTS] database_name [RESTRICT|CASCADE];
+```
+The use of `SCHEMA` and `DATABASE` are interchangeable - they mean the same thing.
+The default behavior is `RESTRICT`, where `DROP DATABASE` will fail if the database is not empty.
+To drop the tables in the database as well, use `DROP DATABASE ... CASCADE`.
+
+`DROP` returns an error if the database doesn't exist, unless `IF EXISTS` is specified
+or the configuration variable [hive.exec.drop.ignorenonexistent](https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-hive.exec.drop.ignorenonexistent)
+is set to true.
+
+### Examples
+
+```sql
+DROP DATABASE db1 CASCADE;
+```
+
+## DROP TABLE
+
+### Description
+
+`DROP TABLE` statement removes metadata and data for this table.
+The data is actually moved to the `.Trash/Current` directory if Trash is configured.
+The metadata is completely lost.
+
+When drop an `EXTERNAL` table, data in the table will not be deleted from the filesystem.
+
+### Syntax
+
+```sql
+DROP TABLE [IF EXISTS] table_name;
+```
+
+`DROP` returns an error if the table doesn't exist, unless `IF EXISTS` is specified
+or the configuration variable [hive.exec.drop.ignorenonexistent](https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-hive.exec.drop.ignorenonexistent)
+is set to true.
+
+### Examples
+
+```sql
+DROP TABLE IF EXISTS t1;
+```
+
+## DROP VIEW
+
+### Description
+
+`DROP VIEW` statement is used to removed metadata for the specified view.
+
+### Syntax
+
+```sql
+DROP VIEW [IF EXISTS] [db_name.]view_name;
+```
+`DROP` returns an error if the view doesn't exist, unless `IF EXISTS` is specified
+or the configuration variable [hive.exec.drop.ignorenonexistent](https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-hive.exec.drop.ignorenonexistent)
+is set to true.
+
+### Examples
+
+```sql
+DROP VIEW IF EXISTS v1;
+```
+
+## DROP MARCO
+
+`DROP MARCO` statement is used to drop the existing `MARCO`.
+Please refer to [CREATE MARCO]({{< ref "docs/dev/table/hiveCompatibility/hiveDialect/create" >}}#create-marco) for how to create `MARCO`.
+
+### Syntax
+
+```sql
+DROP TEMPORARY MACRO [IF EXISTS] macro_name;
+```
+`DROP` returns an error if the view doesn't exist, unless `IF EXISTS` is specified.
+
+### Examples
+
+```sql
+DROP TEMPORARY MACRO IF EXISTS m1;
+```
+
+## DROP FUNCTION
+
+`DROP FUNCTION` statement is used to drop the existing `FUNCTION`.
+
+### Syntax
+
+```sql
+--- Drop temporary function
+DROP TEMPORARY FUNCTION [IF EXISTS] function_name;
+
+--- Drop permanent function
+DROP FUNCTION [IF EXISTS] function_name;
+```
+`DROP` returns an error if the function doesn't exist, unless `IF EXISTS` is specified
+or the configuration variable [hive.exec.drop.ignorenonexistent](https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-hive.exec.drop.ignorenonexistent)
+is set to true.
+
+### Examples
+
+```sql
+DROP FUNCTION IF EXISTS f1;
+```
diff --git a/docs/content/docs/dev/table/hiveCompatibility/hiveDialect/drop.md b/docs/content/docs/dev/table/hiveCompatibility/hiveDialect/drop.md
new file mode 100644
index 00000000000..67bca77e1d7
--- /dev/null
+++ b/docs/content/docs/dev/table/hiveCompatibility/hiveDialect/drop.md
@@ -0,0 +1,146 @@
+---
+title: "DROP Statements"
+weight: 2
+type: docs
+aliases:
+- /dev/table/hiveCompatibility/hiveDialect/create.html
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+  http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# CREATE Statements
+
+With Hive dialect, the following DROP statements are supported for now:
+
+- DROP DATABASE
+- DROP TABLE
+- DROP VIEW
+- DROP MARCO
+- DROP FUNCTION
+
+## DROP DATABASE
+
+### Description
+
+`DROP DATABASE` statement is used to drop a database as well as the tables/directories associated with the database.
+
+### Syntax
+
+```sql
+DROP (DATABASE|SCHEMA) [IF EXISTS] database_name [RESTRICT|CASCADE];
+```
+The use of `SCHEMA` and `DATABASE` are interchangeable - they mean the same thing.
+The default behavior is `RESTRICT`, where `DROP DATABASE` will fail if the database is not empty.
+To drop the tables in the database as well, use `DROP DATABASE ... CASCADE`.
+
+`DROP` returns an error if the database doesn't exist, unless `IF EXISTS` is specified
+or the configuration variable [hive.exec.drop.ignorenonexistent](https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-hive.exec.drop.ignorenonexistent)
+is set to true.
+
+### Examples
+
+```sql
+DROP DATABASE db1 CASCADE;
+```
+
+## DROP TABLE
+
+### Description
+
+`DROP TABLE` statement removes metadata and data for this table.
+The data is actually moved to the `.Trash/Current` directory if Trash is configured.
+The metadata is completely lost.
+
+When drop an `EXTERNAL` table, data in the table will not be deleted from the filesystem.
+
+### Syntax
+
+```sql
+DROP TABLE [IF EXISTS] table_name;
+```
+
+`DROP` returns an error if the table doesn't exist, unless `IF EXISTS` is specified
+or the configuration variable [hive.exec.drop.ignorenonexistent](https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-hive.exec.drop.ignorenonexistent)
+is set to true.
+
+### Examples
+
+```sql
+DROP TABLE IF EXISTS t1;
+```
+
+## DROP VIEW
+
+### Description
+
+`DROP VIEW` statement is used to removed metadata for the specified view.
+
+### Syntax
+
+```sql
+DROP VIEW [IF EXISTS] [db_name.]view_name;
+```
+`DROP` returns an error if the view doesn't exist, unless `IF EXISTS` is specified
+or the configuration variable [hive.exec.drop.ignorenonexistent](https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-hive.exec.drop.ignorenonexistent)
+is set to true.
+
+### Examples
+
+```sql
+DROP VIEW IF EXISTS v1;
+```
+
+## DROP MARCO
+
+`DROP MARCO` statement is used to drop the existing `MARCO`.
+Please refer to [CREATE MARCO]({{< ref "docs/dev/table/hiveCompatibility/hiveDialect/create" >}}#create-marco) for how to create `MARCO`.
+
+### Syntax
+
+```sql
+DROP TEMPORARY MACRO [IF EXISTS] macro_name;
+```
+`DROP` returns an error if the view doesn't exist, unless `IF EXISTS` is specified.
+
+### Examples
+
+```sql
+DROP TEMPORARY MACRO IF EXISTS m1;
+```
+
+## DROP FUNCTION
+
+`DROP FUNCTION` statement is used to drop the existing `FUNCTION`.
+
+### Syntax
+
+```sql
+--- Drop temporary function
+DROP TEMPORARY FUNCTION [IF EXISTS] function_name;
+
+--- Drop permanent function
+DROP FUNCTION [IF EXISTS] function_name;
+```
+`DROP` returns an error if the function doesn't exist, unless `IF EXISTS` is specified
+or the configuration variable [hive.exec.drop.ignorenonexistent](https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-hive.exec.drop.ignorenonexistent)
+is set to true.
+
+### Examples
+
+```sql
+DROP FUNCTION IF EXISTS f1;
+```