The use of Kettle to generate UUID (random number)

  When using Kettle for data storage, it often involves generating a unique identifier for the ID field, and UUID is usually our choice to generate a unique representation. At this time, we need to use the "generate random number" function operator, through the "generate "Random number" can generate UIID. Here's how to use it.

1. In the core object, select "input"->"generate random number", drag the "generate random number" function operator into the conversion page, as shown in the figure below
Insert picture description here
2. Double-click "generate random number", and then enter Field name, and then select the random number type. The ID in the database is generally UUID. Here is also UUID as an example, as shown in the figure below.
Insert picture description here
3. The configuration is complete when generating random numbers here, but the UUID generated here is 36 digits. as through the database ID 36-bit field of 32 bits can be designed by the "conversion" in the "replacement character string" function operator generated UUID in the '-' replace, "string with" parameter here will Configuration display, as shown in the figure below.
Insert picture description here
4. View the generated UUID data through'Preview data' . As shown in the figure below, the introduction of UUID
Insert picture description here
generation is completed. There are many other types of random in the "Generate Random Number" module. However, this method of use is basically the same, depending on the needs of the business scenario.

Guess you like

Origin blog.csdn.net/AnameJL/article/details/115206615