Cannot cast value of type 'array' to type 'record'
See original GitHub issueI am trying to integrate Azure Stream Analytics with Azure Machine Learning and getting the following error:
I am getting the following error:
Cannot cast value of type 'array' to type 'record' in expression 'inputArray'. At line '7' and column '18'. TRY_CAST function can be used to handle values with unexpected type.
- steps: I have deployed an azureml model in aks and linked the model to Azure Stream Analytics
the model input was defined as the following:
input_sample = np.array([[34.13,34.13,34.13,34.13,3.48,34.13,34.13,34.13,34.13,34.13,34.13]])
@input_schema('data', NumpyParameterType(input_sample))
in Azure Stream Analytics I created an input array
function createArray(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) {
'use strict';
var array = [v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11]
return array;
}
and when I am trying to invoke the Azure Machine Learning UDF using the following query:
WITH
ModelInput AS (
SELECT udf.createArray(cast(v1 as float), cast(v2 as float), cast(v3 as float), cast(v4 as float), cast(v5 as float), cast(v6 as float), cast(v7 as float), cast(v8 as float), cast(v9 as float), cast(v10 as float), cast(v11 as float)) as inputArray
FROM input
)
SELECT udf.score(inputArray)
INTO output
FROM ModelInput
WHERE inputArray is not null
I am getting the following error:
Cannot cast value of type 'array' to type 'record' in expression 'inputArray'. At line '7' and column '18'. TRY_CAST function can be used to handle values with unexpected type.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Best way to cast array (text[]) to record-type?
PostgreSQL has the ability to create record types. ... AS t(a); ERROR: cannot cast type text[] to census.series_id LINE 1: SELECT a::census.
Read more >Cannot convert value of type '[Record]' to ...
records is [Record] and you are trying to casting it as single Record which is not an Array . So it is not...
Read more >Input validation in Azure Stream Analytics queries
Input validation in Azure Stream Analytics queries ... Exception** Cannot cast value of type 'record' to type 'array' in expression 'r .
Read more >cast() Function - Appian 23.2
The type to which the value should be cast. This may be retrieved by using typeof(x), where x is a value of the...
Read more >Casting (and Non-Casting!) in TypeScript | by Tar Viturawong
Type casting — the act of converting the type of a value to another ... In TypeScript land, arrays and functions are subtypes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When sending one input array as part of http request to the endpoint, it returns the right result:
The problem is with how your endpoint handles multiple inputs part of the same input. If 2 arrays are sent as part of the same http request, the expectation is that there are equal number of results in the response from endpoint. I tried sending 2 arrays but got only 1 result which doesn’t make sense.
It should’ve returned: [ 5.0, 5.0 ]
@sidramadoss thanks for the clarification. ASA and its logic are new for me. I was thinking it should support that to predict something you might need some history.