DROP Statements

DROP statements are used to remove a catalog with the given catalog name or to remove a registered table/view/function from the current or specified Catalog.
DROP语句用于删除具有给定目录名称的目录,或从当前或指定的目录中删除已注册的表/视图/函数。

Flink SQL supports the following DROP statements for now:
Flink SQL目前支持以下DROP语句:

  • DROP CATALOG
  • DROP TABLE
  • DROP DATABASE
  • DROP VIEW
  • DROP FUNCTION

Run a DROP statement

Java
DROP statements can be executed with the executeSql() method of the TableEnvironment. The executeSql() method returns ‘OK’ for a successful DROP operation, otherwise will throw an exception.
DROP语句可以使用TableEnvironment的executeSql()方法执行。executeSql()方法为成功的DROP操作返回“OK”,否则将引发异常。

The following examples show how to run a DROP statement in TableEnvironment.
以下示例显示了如何在TableEnvironment中运行DROP语句。

TableEnvironment tableEnv = TableEnvironment.create(...);// register a table named "Orders"
tableEnv.executeSql("CREATE TABLE Orders (`user` BIGINT, product STRING, amount INT) WITH (...)");// a string array: ["Orders"]
String[] tables = tableEnv.listTables();
// or tableEnv.executeSql("SHOW TABLES").print();// drop "Orders" table from catalog
tableEnv.executeSql("DROP TABLE Orders");// an empty string array
String[] tables = tableEnv.listTables();
// or tableEnv.executeSql("SHOW TABLES").print();

SQL CLI
DROP statements can be in SQL CLI.
DROP语句可以在SQL CLI中。

The following examples show how to run a DROP statement in SQL CLI.
以下示例显示了如何在SQL CLI中运行DROP语句。

Flink SQL> CREATE TABLE Orders (`user` BIGINT, product STRING, amount INT) WITH (...);
[INFO] Table has been created.Flink SQL> SHOW TABLES;
OrdersFlink SQL> DROP TABLE Orders;
[INFO] Table has been removed.Flink SQL> SHOW TABLES;
[INFO] Result was empty.

DROP CATALOG

DROP CATALOG [IF EXISTS] catalog_name

Drop a catalog with the given catalog name.
删除具有给定目录名称的目录。

IF EXISTS

If the catalog does not exist, nothing happens.
如果目录不存在,则不会发生任何事情。

DROP TABLE

DROP [TEMPORARY] TABLE [IF EXISTS] [catalog_name.][db_name.]table_name

Drop a table with the given table name. If the table to drop does not exist, an exception is thrown.
删除具有给定表名的表。如果要删除的表不存在,将引发异常。

TEMPORARY

Drop temporary table that has catalog and database namespaces.
删除具有目录和数据库命名空间的临时表。

IF EXISTS

If the table does not exist, nothing happens.
如果表不存在,则不会发生任何事情。

DROP DATABASE

DROP DATABASE [IF EXISTS] [catalog_name.]db_name [ (RESTRICT | CASCADE) ]

Drop a database with the given database name. If the database to drop does not exist, an exception is thrown.
删除具有给定数据库名称的数据库。如果要删除的数据库不存在,将引发异常。

IF EXISTS

If the database does not exist, nothing happens.
如果数据库不存在,则不会发生任何事情。

RESTRICT

Dropping a non-empty database triggers an exception. Enabled by default.
删除非空数据库会触发异常。默认情况下启用。

CASCADE

Dropping a non-empty database also drops all associated tables and functions.
删除非空数据库也会删除所有关联的表和函数。

DROP VIEW

DROP [TEMPORARY] VIEW  [IF EXISTS] [catalog_name.][db_name.]view_name

Drop a view that has catalog and database namespaces. If the view to drop does not exist, an exception is thrown.
删除具有目录和数据库名称空间的视图。如果要删除的视图不存在,将引发异常。

TEMPORARY

Drop temporary view that has catalog and database namespaces.
删除具有目录和数据库命名空间的临时视图。

IF EXISTS

If the view does not exist, nothing happens.
如果视图不存在,则不会发生任何事情。

MAINTAIN DEPENDENCIES Flink does not maintain dependencies of view by CASCADE/RESTRICT keywords, the current way is producing postpone error message when user tries to use the view under the scenarios like the underlying table of view has been dropped.
维护依赖性:Flink不通过CASCADE/RESTRICT关键字维护视图的依赖性,当前的方法是当用户试图在视图的基础表被删除的情况下使用视图时,生成延迟错误消息。

DROP FUNCTION

DROP [TEMPORARY|TEMPORARY SYSTEM] FUNCTION [IF EXISTS] [catalog_name.][db_name.]function_name;

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.
如果函数不存在,则不会发生任何事情。

Flink SQL:DROP Statements相关推荐

  1. Flink SQL: SET Statements

    SET Statements SET statements are used to modify the configuration or list the configuration. SET语句用 ...

  2. Flink SQL Client CLI 使用入门

    参照:https://blog.csdn.net/boling_cavalry/article/details/105964425 一.SQL Client Flink 的 Table & S ...

  3. 使用flink Table Sql api来构建批量和流式应用(3)Flink Sql 使用

    从flink的官方文档,我们知道flink的编程模型分为四层,sql层是最高层的api,Table api是中间层,DataStream/DataSet Api 是核心,stateful Stream ...

  4. Flink SQL 的 9 个示例

    作者:贺小令(晓令) 本文由阿里巴巴技术专家贺小令分享,社区志愿者郑仲尼整理.文章基于 Flink 1.9 版本,从用户的角度来讲解 Flink 1.9 版本中 SQL 相关原理及部分功能变更,希望对 ...

  5. Flink SQL Client注册JAVA UDF完整流程

    概述 听大佬说[1]里面有flink sql client注册udf的方法 去看了一眼,全是文字,闹心,索性琢磨了一下,记录下来. UDF的完整maven工程 https://github.com/a ...

  6. Flink SQL Client方言切换与datagen->Hive(DDL形式+streaming形式)

    概述 本文是对[1]的完整复现,补充了[1]中缺失的大量细节. 切换方言 切换目标 Flink SQL Client命令 切换为hive SET table.sql-dialect=hive; 切换为 ...

  7. flink sql client读取hive时卡住

    问题复现如下: 查看$FLINK_HOME/log/flink-appleyuchi-sql-client-Desktop.log 2020-12-23 11:48:56,811 INFO  org. ...

  8. 1.30.Flink SQL案例将Kafka数据写入hive

    1.30.Flink SQL案例将Kafka数据写入hive 1.30.1.1.场景,环境,配置准备 1.30.1.2.案例代码 1.30.1.2.1.编写pom.xml文件 1.30.1.2.2.M ...

  9. 网易游戏 Flink SQL 平台化实践

    摘要:本文整理自网易游戏资深开发工程师林小铂在 Flink Forward Asia 2021 平台建设专场的演讲.主要内容包括: 网易游戏 Flink SQL 发展历程 基于模板 jar 的 Str ...

最新文章

  1. Linux关于终端的基本概念汇总(tty/pty)(转)
  2. kubectl 重启pod_记一次kyverno重启解决
  3. python 运算符 (算术运算符、比较(关系)运算符、赋值运算符、逻辑运算符、位运算符、成员运算符、身份运算符、运算符优先级)(与或非)(异或)
  4. SQL入门经典(第5版)pdf
  5. 我的世界java 内存_我的世界如何分配内存
  6. LintCode初级题——fizz buzz
  7. 全球研发投入榜:中国第二逼近美国,以色列最下血本 | 联合国数据
  8. Spark SQL将rdd转换为数据集-反射来推断Inferring the Schema Using Reflection
  9. redis运行状态图形化监控工具 — RedisLive
  10. 虚拟IP与arp协议
  11. AD7124采集工作流程
  12. 类似818tu.c微信小说分销系统设计之多公众号网页授权自动登录源码分享
  13. vb计算机清除菜单代码,动态增减菜单用法 _VB编程语言动态增减菜单-w3school教程...
  14. 电磁铁基础知识介绍及各系列性能比较
  15. 空转工具推荐 | 10款空间转录组去卷积工具的综合比较
  16. JavaScript多线程编程
  17. 非常全面的前端协作规范
  18. 什么软件可以测试家里的宽带,技术贴 | 如何简单又专业的测试自己家的网速是否达标...
  19. (转)腾讯区块链方案白皮书:底层技术平台及五大场景解决方案
  20. JavaSE进阶26 - IO流概述、字节流、字符流、转换流、缓冲流

热门文章

  1. wd移动硬盘支持linux,玩转移动硬盘存储之WD篇
  2. 力扣-55.跳跃游戏
  3. 第一大题、分析(共14小题,满分100分)
  4. Unity的prefab
  5. //1.13 自增自减运算符(++,--)
  6. JAVA桌面版、J2ME版、ANDROID版贪吃蛇
  7. 2012_11月总结分享
  8. HTML 统一资源定位器
  9. finereport实现报表表头固定
  10. Python编程(廖雪峰)笔记