Equivalent to: DROP TABLE {{db}}.{{tbl_name}} IF NOT EXISTS PURGE.
| 94 | |
| 95 | /// Equivalent to: DROP TABLE {{db}}.{{tbl_name}} IF NOT EXISTS PURGE. |
| 96 | static Status _dropTable(CatalogServiceIf* svc, const string& ip_addr, const string& db, |
| 97 | const string& tbl_name) { |
| 98 | TDdlExecResponse resp; |
| 99 | TDdlExecRequest req; |
| 100 | Status stat; |
| 101 | TDropTableOrViewParams drop_tbl; |
| 102 | TTableName t_tbl_name; |
| 103 | TDdlQueryOptions t_query_opts; |
| 104 | |
| 105 | t_query_opts.__set_sync_ddl(true); |
| 106 | |
| 107 | t_tbl_name.__set_db_name(db); |
| 108 | t_tbl_name.__set_table_name(tbl_name); |
| 109 | |
| 110 | drop_tbl.__set_if_exists(true); |
| 111 | drop_tbl.__set_is_table(true); |
| 112 | drop_tbl.__set_purge(true); |
| 113 | drop_tbl.__set_table_name(t_tbl_name); |
| 114 | |
| 115 | req.__set_header(_getHeader(ip_addr)); |
| 116 | req.__set_ddl_type(TDdlType::type::DROP_TABLE); |
| 117 | req.__set_query_options(t_query_opts); |
| 118 | req.__set_drop_table_or_view_params(drop_tbl); |
| 119 | |
| 120 | svc->ExecDdl(resp, req); |
| 121 | |
| 122 | stat = StatusFromThrift(resp.result.status); |
| 123 | if (!stat.ok()) { |
| 124 | stat.AddDetail(StrCat("could not drop table '", _fullTableName(db, tbl_name), "'")); |
| 125 | } |
| 126 | |
| 127 | return stat; |
| 128 | } // function _dropTable |
| 129 | |
| 130 | /// Equivalent to: CREATE DATABASE IF NOT EXISTS {{db}}. |
| 131 | static Status _setupDb(CatalogServiceIf* svc, const string& ip_addr, const string& db) { |
no test coverage detected