← define_operator operator page · definitions/define_operator/dataset/dataset_argument
pandas ✅ · DuckDB ✅
a parameter of type dataset, with no component constraint, called with DS_1.
define operator: datasetType ::= dataset { ... }, here without constraints: the super-type of the Data Set types, "any dataset" (User Manual). The script ends with end operator, as the page's examples and the grammar do; its syntax line writes end define operator.
Me_1 * 2 on each data point, as "the operator is applied to the values of all the Measures": (1, 20) and (2, 40).
define operator twice (ds dataset)
returns dataset is
ds * 2
end operator;
DS_r := twice(DS_1);
| Id_1 | Me_1 |
|---|---|
| 1 | 10 |
| 2 | 20 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{
"name": "Id_1",
"type": "Integer",
"role": "Identifier",
"nullable": false
},
{
"name": "Me_1",
"type": "Integer",
"role": "Measure",
"nullable": true
}
]
}
]
}
| Id_1 | Me_1 |
|---|---|
| 1 | 20 |
| 2 | 40 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{
"name": "Id_1",
"type": "Integer",
"role": "Identifier"
},
{
"name": "Me_1",
"type": "Integer",
"role": "Measure"
}
]
}
]
}