更新时间:2022-09-08 GMT+08:00
分享

修改表

功能简介

通过KuduClient.alterTable(String name, AlterTableOptions ato)方法修改表对象。

代码样例

如下是写数据的代码片段:

// Alter the table, adding a column with a default value.
// Note: after altering the table, the table needs to be re-opened.
AlterTableOptions ato = new AlterTableOptions();
ato.addColumn("added", org.apache.kudu.Type.DOUBLE, DEFAULT_DOUBLE);
client.alterTable(tableName, ato);

示例代码中,AlterTableOptions是要修改表属性的集合,这里往表里新增加了一列。

分享:

    相关文档

    相关产品