Help Center>
MapReduce Service>
Developer Guide (Normal_3.x)>
ClickHouse Development Guide (Normal Mode)>
Application Development>
Sample Code>
Deleting a Table
Updated on 2023-08-31 GMT+08:00
Deleting a Table
The following code snippet is provided in the dropTable method of the Demo class in the com.huawei.clickhouse.examples package. The code snippet deletes the backup table and distributed table created in Creating a Table.
private void dropTable(String databaseName, String tableName, String clusterName) throws Exception { String dropLocalTableSql = "drop table if exists " + databaseName + "." + tableName + " on cluster " + clusterName; String dropDisTableSql = "drop table if exists " + databaseName + "." + tableName + "_all" + " on cluster " + clusterName; ArrayList<String> sqlList = new ArrayList<String>(); sqlList.add(dropLocalTableSql); sqlList.add(dropDisTableSql); util.exeSql(sqlList); }
Parent topic: Sample Code
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot