← udo_call operator page · general/udo_call/default_omitted/trailing_default

Trailing default 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

A call that omits its last argument, an optional one: diff2(SC_1) with SC_1 = 10.

Manual:

User-defined operator call: "One or more optional operands in the last positions can be simply omitted", and define operator: "If parameterDefaultValue is specified then the parameter is optional".

Expected:

y takes its default 1, so SC_r = 10 - 1 = 9, an Integer.

script.vtl ⇩

define operator diff2 (x integer, y integer default 1)
  returns integer is
    x - y
end operator;

SC_r := diff2(SC_1);

input/scalars.csv ⇩

SC_1
10

input/scalars.json ⇩

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

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_r", "type": "Integer", "value": "9"}
  ]
}