Configuring Upsert Operation Service
Use the
Upsert Operation template to configure an adapter service that inserts or updates records of a table. If the Row Id does not exist, then the upsert operation inserts it as a new record. If the Row Id exists, then the upsert operation updates the respective records in the table. This service can be performed on single or multiple records. For more information about adapter services, see
Using Adapter Services.
Be sure to review the section
Before Configuring or Managing Adapter Services, before you configure adapter services.
![*](icon_task_xpe.png)
To configure an adapter service using the Upsert Operation template
1. In Designer, right-click the package in which the service should be contained and select New > Adapter Service.
2. Select the parent namespace, type a name for the adapter service, and click Next.
3. Select Adapter for Apache HBase as the adapter type and click Next.
4. Select the appropriate Adapter Connection Name and click Next.
5. From the list of available templates, select the Upsert Operation template and click Finish.
The adapter service editor for the adapter service appears. You can select the Adapter Settings tab at any time to confirm adapter service properties such as the Adapter Name, Adapter Connection Name, and Adapter Service Template as necessary.
6. Select the Schema tab to configure the database table, using the following fields:
Field | Description/Action |
HBase Table | Select a table name from the list of tables. |
Column Family | Displays the list of column families for the selected table name. |
Select | Select the check box for the corresponding column family to query. |
Sampling Range | Specify the number of records to be scanned to get minimum set of column qualifiers. These column qualifiers are listed in the Columns tab. Value can be entered in the following formats: ![*](chapterTOC_bullet.png) Input value can be an integer and it should be greater than 0. For example, if you provide Sampling Range: 10, then the service will scan initial 10 records of the selected table. ![*](chapterTOC_bullet.png) Input value can be the range between two row ids separated by hyphen (-). The start row id and the end row id should be valid row ids, present in the selected table. The start Row Id should be lexicographically smaller than the end Row Id. For example, if you provide Sampling Range: row100-row1000, then the service will scan all the records which contain row ids between row100 to row1000. Note: Sampling is not performed for the values which do not contain the above formats, and the list of column qualifier under Columns tab will remain empty. |
7. Use the Columns tab to define the column qualifiers using the following fields:
Use the
![](../hbase-webhelp/images/table_insertrow.gif)
icon to create a new row as needed. You can use the
![](../hbase-webhelp/images/append_all_rows.gif)
icon to fill in all rows to the table.
Use the following fields:
Field | Description/Action |
Row ID Data Type | Select the data type to retrieve the required row id. |
Column Family | Provides the list of column families based on the selection made in the Schema tab. |
Select Column Qualifier | Select the column qualifier which can be retrieved for the corresponding column family. The Select Column Qualifier field is displayed as a drop down list. These values are retrieved based on the sampling range provided in the Schema tab. For lower section, you can specify the column qualifiers which are not listed in the column qualifier field of upper section. |
Column Qualifier Type | The Select Column Qualifier field supports the following data types: ![*](chapterTOC_bullet.png) java.lang.String ![*](chapterTOC_bullet.png) byte array |
Enter Column Qualifier | Specify the column qualifiers which are not listed in the Select Column Qualifier field. |
Note:
If you change the values of Table Name and Column Family of Schema tab then, the following fields for Columns tab changes:
![*](chapterTOC_bullet.png)
The values of
Column Family and
Select Column Qualifier changes automatically.
![*](chapterTOC_bullet.png)
The
Column Family changes automatically, but you need to manually change the values of
Enter Column Qualifier.
8. To verify input or output information for the service, use the Input/Output tab as required.
The below field is auto generated under input section of Input/Output tab:
Field | Description/Action |
Row Ids | Specify the list of row ids to delete the corresponding records. Note: It is mandatory to provide row ids as input to delete the records. |
9. From the File menu, select Save.