← random operator page · numeric/random/sc/single_draw

Single draw 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

random(SC_1, SC_2) on scalars, with SC_1 = 15 and SC_2 = 12 as in the page's valid syntax random(15,12).

Manual:

Random: "The operator returns a random decimal number >= 0 and <1."

Expected:

SC_r is a Number in [0, 1) that is the same on every run; a draw has no fixed value, so the expected value is null and the property is checked.

script.vtl ⇩

SC_r := random(SC_1, SC_2);

input/scalars.csv ⇩

SC_1SC_2
1512

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "Integer"},
    {"name": "SC_2", "type": "Integer"}
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {
      "name": "SC_r",
      "type": "Number",
      "value": null
    }
  ]
}