Skip to content

Volatility::Volatile does not work for functions with arguments #13000

@agscpp

Description

@agscpp

Describe the bug

For functions whose signature contains Volatility::Volatile and arguments, invoke is called once and without _number_rows

To Reproduce

**TABLE:**
"+-------+", //
"| value |", //
"+-------+", //
"| val_1 |", //
"| val_2 |", //
"| val_3 |", //
"| val_4 |", //
"| val_5 |", //
"| val_6 |", //
"| val_7 |", //
"+-------+",
SELECT random(1, 10) AS r, table.value AS value FROM table;

random(a, b) is a function that returns a random value in the range from a to b. This function has the following signature:
Signature::exact(vec![DataType::Int32, DataType::Int32], Volatility::Volatile)

Expected behavior

"+-----------+", //
"| r | value |", //
"+-----------+", //
"| 7 | val_1 |", //
"| 1 | val_2 |", //
"| 7 | val_3 |", //
"| 3 | val_4 |", //
"| 8 | val_5 |", //
"| 4 | val_6 |", //
"| 2 | val_7 |", //
"+-----------+",

Received behavior

"+-----------+", //
"| r | value |", //
"+-----------+", //
"| 7 | val_1 |", //
"| 7 | val_2 |", //
"| 7 | val_3 |", //
"| 7 | val_4 |", //
"| 7 | val_5 |", //
"| 7 | val_6 |", //
"| 7 | val_7 |", //
"+-----------+",

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions