Background information
When you insert a large amount of data, you can insert the data in batches based on the partitions to which the data belongs. This improves the efficiency of data insertion.
The ob-partition-calculator component provides an API for calculating the partitions to which data records belong.
This topic describes the operating principle of the ob-partition-calculator component.
Workflow
The following figure shows the workflow of the ob-partition-calculator component:

The ob-partition-calculator component queries the partition information of a table based on the connection information that you specified. It obtains the following partition information:
Partitioning type and number of partitions
Field types, field names, and number of fields of partitions
Values and upper limits of LIST and RANGE partitions
Addresses of leaders corresponding to the partitions
The ob-partition-calculator component builds a partitioning model based on the partition information, to calculate the partition values corresponding to the input data.
Partitioning types
MySQL mode
KEY partitioning
HASH partitioning
LIST partitioning
LIST COLUMNS partitioning
RANGE partitioning
RANGE COLUMNS partitioning
Oracle mode
HASH partitioning
LIST partitioning
RANGE partitioning
Supported value types
The ob-partition-calculator component supports the calculation for types of fields that can be used as partitioning keys in OceanBase Database. For more information about the field types, see the following topics:
Partition overview (MySQL mode)
Partition overview (Oracle mode)
Call method
For more information about how to call the ob-partition-calculator component, see Use the ob-partition-calculator component.