Functions for Generating Pseudo-Random Numbers

    Note

    Non-cryptographic generators of pseudo-random numbers are used.

    Returns a pseudo-random UInt32 number, evenly distributed among all UInt32-type numbers.

    Uses a linear congruential generator.

    rand64

    Returns a pseudo-random UInt64 number, evenly distributed among all UInt64-type numbers.

    Uses a linear congruential generator.

    Syntax

    Arguments

    • — resulting in any of the supported data types. The resulting value is discarded, but the expression itself if used for bypassing if the function is called multiple times in one query. Optional parameter.

    Returned value

    • Pseudo-random number.

    Type: UInt32.

    Example

    Query:

    Random Functions for Working with Strings

    randomString

    randomPrintableASCII

    fuzzBits

    Syntax

    Inverts bits of s, each with probability .

    Arguments
    - s - or FixedString
    - - constant Float32/64

    Returned value
    Fuzzed string with same as s type.

    Example

    ``` text
    ┌─fuzzBits(materialize(‘abacaba’), 0.1)─┐
    │ abaaaja │
    │ a*cjab+ │
    │ aeca2A │
    └───────────────────────────────────────┘