On this page

Modifying a Table

Updated on 2022-09-14 GMT+08:00

Function

Modify a table object using KuduClient.alterTable(String name, AlterTableOptions ato).

Sample Code

The code snippet for writing data is as follows:

// 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);
NOTE:

In the sample code, AlterTableOptions is the set of table attributes to be modified. In the example, a column is added to the table.

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback