Help Center/ MapReduce Service/ Developer Guide (Normal_3.x)/ Kudu Development Guide (Normal Mode)/ Developing an Application/ Sample Code Description/ Modifying a Table
Updated on 2022-08-16 GMT+08:00
Modifying a Table
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);
In the sample code, AlterTableOptions is the set of table attributes to be modified. In the example, a column is added to the table.
Parent topic: Sample Code Description
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