6.4 删除表

    /**
     * 删除指定表名的表
     * 删除前要先 disable 表, 才能删除
     * @param tableName
     * @throws IOException
     */
    private static void deleteTable(String tableName) throws IOException {
        if (isTableExists(tableName)) {
            admin.disableTable(TableName.valueOf(tableName));
            admin.deleteTable(TableName.valueOf(tableName));
        }else{
            System.out.println("你要删除的表: " + tableName + " 不存在!");
        }
    }
Copyright © 尚硅谷大数据 2019 all right reserved,powered by Gitbook
该文件最后修订时间: 2019-03-26 08:52:09

results matching ""

    No results matching ""