Skip to content

Commit 774d98b

Browse files
FE: allow defining the quantity of estimated rows for udfs that returns table
1 parent 690a39e commit 774d98b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

forward_engineering/ddlProvider/ddlHelpers/functionHelper.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ module.exports = ({ _, templates, assignTemplates, getFunctionArguments, getName
6767
}
6868
};
6969
const getExecutionRows = (value, udf) => {
70-
if (!value || !udf.functionReturnsSetOf) {
70+
if (!value || (!udf.functionReturnsSetOf && !isFunctionReturnsTable(udf))) {
7171
return '';
7272
}
7373

@@ -84,6 +84,11 @@ module.exports = ({ _, templates, assignTemplates, getFunctionArguments, getName
8484
}
8585
};
8686

87+
const isFunctionReturnsTable = (udf) => {
88+
const returnType = (udf.functionReturnType || '').replace(/\s/g, '').toUpperCase();
89+
return returnType.startsWith('TABLE(');
90+
};
91+
8792
return {
8893
getFunctionsScript,
8994
};

properties_pane/container_level/containerLevelConfig.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,7 @@ making sure that you maintain a proper JSON format.
312312
"valueType": "number",
313313
"minValue": 0,
314314
"step": 1,
315-
"propertyTooltip": "A positive number giving the estimated number of rows that the planner should expect the function to return.",
316-
"dependency": {
317-
"key": "functionReturnsSetOf",
318-
"value": true
319-
}
315+
"propertyTooltip": "A positive number giving the estimated number of rows that the planner should expect the function to return."
320316
},
321317
{
322318
"propertyName": "Support function",

0 commit comments

Comments
 (0)