Determining the Write Operation Type
Write operation type description
| Write Operation Type | Supported Table Types | Feature | How to Use | Preferred Scenario |
|---|---|---|---|---|
| insert into | cow/mor | The data written using INSERT INTO will overwrite the inventory data with the same primary key in the table. |
| Writing the result of multi-source table association query to the Hudi table |
| insert overwrite | cow/mor |
|
| COW table, partition overwriting |
| insert overwrite table | cow/mor | The entire table or partitions can be overwritten. |
| Overwriting the entire table |
| bulk_insert | cow/mor |
| For details, see Common Parameters and Application Scenarios. | Hudi table initialization |
| update | cow/mor | Updating columns in batches |
| Update the values of a column in batches. |
| merge into | cow/mor | Perform update, insert, and delete using one statement. |
| You are not advised to use the MergeInto capability of the Hudi community, as it may lead to data consistency issues. Identified issue scenarios include performing Delete before MergeInto, and there may be other undiscovered scenarios with potential risks. It is advised to use InsertInto/InsertOverwrite/Update/Delete instead. |
| delete | cow/mor | Deleting a small amount of data |
| Delete a small amount of data, for example, less than 30% of the data in a table. |
Precautions
- The delete command is not used to delete a partition. To delete a partition, run the drop partition command. For details, see Introduction to Common SQL Statements.
- For bucket indexes, the error message Find multiple files at partition xxx belongs to the same bucket id = xxx may be displayed when a duplicate bucket ID exists.
Common error scenarios:
- The INSERT INTO job conflicts with the TRUNCATE job. The TRUNCATE job is re-initializing the Hudi table, but the INSERT INTO job is writing files. As a result, the file added in the last INSERT INTO job remains in the re-initialized Hudi table.
- The insert overwrite job is switched to the insert into job. When the insert overwrite job writes data to Hudi, the clean and archive configurations must be correctly used according to Selecting a Proper Table Service Execution Mode. Otherwise, the replacecommit metadata of the insert overwrite job has been archived, but the data file still exists.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot