Skip to main content

random_float

Generate a random float within the provided interval.

Parameters

NameDescriptionDefaultRequiredSupported DB types
columnThe name of the column to be affectedYesfloat4, float8
minThe minimum threshold for the random value. The value range depends on the column type.Yes-
maxThe maximum threshold for the random value. The value range depends on the column type.Yes-
decimalThe decimal of the random float value (number of digits after the decimal point)4No-
keep_nullIndicates whether NULL values should be replaced with transformed values or nottrueNo-
engineThe engine used for generating the values [random, hash]. Use hash for deterministic generationrandomNo-

Dynamic parameters

ParameterSupported types
minfloat4, float8
maxfloat4, float8

Description

The RandomFloat transformer generates a random float value within the provided interval, starting from min to max, with the option to specify the number of decimal digits by using the decimal parameter. The behaviour for NULL values can be configured using the keep_null parameter.

The engine parameter allows you to choose between random and hash engines for generating values. Read more about the engines in the Transformation engines section.

Example: Generate random price

In this example, the RandomFloat transformer generates random prices in the range from 0.1 to 7000 while maintaining a decimal of up to 2 digits.

RandomFloat transformer example
- schema: "sales"
name: "salesorderdetail"
columns_type_override: # (1)
"unitprice": "float8"
transformers:
- name: "RandomFloat"
params:
column: "unitprice"
min: 0.1
max: 7000
decimal: 2
  1. The type overrides applied for example because the playground database does not contain any tables with float columns.

Result:

ColumnOriginalValueTransformedValue
unitprice2024.9944449.7
Copyright © GreenMask 2026