Home | Table of Contents | Simple Lookup Table | CloverETL 4.6.1
--- | --- | ---
Prev | Types of Lookup Tables | Next

### Simple Lookup Table

# Available in Community Designer

All data records stored in simple lookup table are kept in memory. For this reason, to store all data records from the lookup table, sufficient memory must be available. If data records are loaded to a simple lookup table from a data file, the size of the available memory should be approximately at least 6 times bigger than that of the data file. However, this multiplier is different for different types of data records stored in the data file.

Simple lookup table allows storing multiple data records with the same key value. If you do not allow storing duplicated values, the last value will be stored.

#### Creating Simple Lookup Table

In the first step of the wizard, choose Simple lookup.

In the next step, set up the required properties: in the Table definition tab, give a Name to the lookup table, select the corresponding Metadata and the Key that should be used to look up data records from the table.

Optionally, you can select a Charset and the Initial size of the lookup table (512 by default). You can change the default value by changing the `Lookup.LOOKUP_INITIAL_CAPACITY` value in `defaultProperties`.

Figure 34.6. Simple Lookup Table Wizard

##### Key

After clicking the button on the right side from the Key area, you will be presented with the Edit key dialog which helps you select the Key. The list on the left side contains metadata fields and their data types. The list on the right side contains metadata fields that form the key.

Figure 34.7. Edit Key Wizard

To add a metadata field to the key, drag the field from the list on the left and drop it to the list on the right. Any highlighted metadata field can be added to the list with an arrow too.

You can move the field name(s) into the Key parts pane by highlighting the field name(s) in the Field pane and clicking the Right arrow button. You can keep moving more fields into the Key parts pane.

You can also change the position of any of them in the list of the Key parts by clicking the Up or Down buttons. The key parts that are higher in the list have higher priority. When you have finished, you only need to click OK.

You can also remove any key part by highlighting it and clicking the Left arrow button.

##### Data Source Tab

In the Data source tab, you can either locate the file URL or fill in the grid after clicking the Edit data button. After clicking OK, the data will appear in the Data text area. If you use LookupTableReaderWriter to fill in the table, you do not need to specify data on the Data source tab.

Figure 34.8. Simple Lookup Table Wizard with File URL

Figure 34.9. Simple Lookup Table Wizard with Data

You can set or edit the data after clicking the Edit data button.

Figure 34.10. Changing Data

After all has been done, you can click OK and then Finish.

Simple lookup table are allowed to contain data specified directly in the grid, data in the file or data that can be read using LookupTableReaderWriter.

| Important
Remember that you can also check the Allow key duplicates checkbox. This way, you are allowing multiple data records with the same key value (duplicate records). If you want that only one record per each key value is contained in Simple lookup table, leave the mentioned checkbox unchecked (the default setting). If only one record is selected, new records overwrite the older ones. In such a case, the last record is the only one that is included in Simple lookup table.

Prev | Up | Next
Types of Lookup Tables | Home | Table of Contents | Database Lookup Table