microsoft / vscode-asa

Azure Stream Analytics In VSCode
Creative Commons Attribution 4.0 International
10 stars 19 forks source link

Errors encountered when running UDA #60

Closed ruoxiren closed 2 years ago

ruoxiren commented 2 years ago

Hi, I created a JS function UDA: Functions/MergeJSON.js.json:

{
    "Name": "MergeJSON",
    "Type": "Aggregate",
    "ScriptType": "JSFunction",
    "FunctionInputs": [
        {
            "DataType": "any",
            "IsConfigurationParameter": null
        },
        {
            "DataType": "any",
            "IsConfigurationParameter": null
        }
    ],
    "OutputType": "any"
}

asaproj.json:

{
    "name": "JSONMerge",
    "startFile": "JSONMerge.asaql",
    "configurations": [
        {
            "filePath": "JobConfig.json",
            "subType": "JobConfig"
        },
        {
            "filePath": "Inputs/Local_testInput.json",
            "subType": "InputMock"
        },
        {
            "filePath": "Functions/MergeJSON.js.json",
            "subType": "JSFunction"
        }
    ]
}

But when I was running JSONMerge.asaql, It gave me the following error:

[Error] 11/23/2021 11:01:19 PM : Function 'mergejson' has unsupported prefix 'uda'. User defined function calls must start with "udf." prefix.

But my UDA was created through VSCode command as instructed. How to solve this problem? Any suggestions?

Fleid commented 2 years ago

Hi there, Could you please share your query, specifically where you call the UDA. The error message looks more like a syntax issue in the query than something related to the wiring of your UDA.

Specifically, it looks like you're missing a GROUP BY statement for that UDA.

ruoxiren commented 2 years ago

Hi there, Could you please share your query, specifically where you call the UDA. The error message looks more like a syntax issue in the query than something related to the wiring of your UDA.

Specifically, it looks like you're missing a GROUP BY statement for that UDA.

Thank you! I added "GROUP BY" then it ran correctly.