You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a console application that streams JSON data to an Azure IoT hub with the following format:
{
"Name": "testname",
"testvalue": 0,
}
This JSON represents a C# model in my console app, which looks like this:
public class testmodel
{
public double Name { get; set; }
public double testvalue { get; set; }
}
After the data has been sent up to the hub, my stream analytics job processes it and outputs it to my PostgreSQL database in the testtable table, which has the following columns:
name (varchar)
testvalue (float4)
The query I'm using for this is:
SELECT
Input.Name AS name
,CAST(Input.testvalue AS float) AS testvalue
INTO
[test-db]
FROM
[iothub] AS Input TIMESTAMP BY Input.EventProcessedUtcTime
However, when the analytics job tries to insert the data, I encounter errors indicating that the conversion from bigint to float is failing.
The problem here is that the "testvalue" field sometimes includes decimals and sometimes does not. This inconsistency is causing the issue: when the "testvalue" field contains decimals, the conversion works correctly, but when it does not contain decimals, the conversion fails.
The text was updated successfully, but these errors were encountered:
Hello,
I have a console application that streams JSON data to an Azure IoT hub with the following format:
This JSON represents a C# model in my console app, which looks like this:
After the data has been sent up to the hub, my stream analytics job processes it and outputs it to my PostgreSQL database in the testtable table, which has the following columns:
The query I'm using for this is:
However, when the analytics job tries to insert the data, I encounter errors indicating that the conversion from bigint to float is failing.
The problem here is that the "testvalue" field sometimes includes decimals and sometimes does not. This inconsistency is causing the issue: when the "testvalue" field contains decimals, the conversion works correctly, but when it does not contain decimals, the conversion fails.
The text was updated successfully, but these errors were encountered: