2

I am Passing the following Json input from Eventhub to Stream Analytics.

{"meter_totalcycleenergy":null,"Test2": 20}, {"meter_totalcycleenergy":40,"Test2":20}

But the job is failing stating the error.

Encountered error trying to write 1 event(s): Cannot convert from property 'meter_totalcycleenergy' of type 'System.String' to column 'meter_totalcycleenergy' of type 'System.Single'.

Error Image How to handle such conditions.

I think Json nulls are not exactly SQL NULLs, so what would be the proper way to check for null values in a query?

Datatype of meter_totalcycleenergy is float in my database.

1
  • Adding a IS NOT NULL will works Commented Mar 14, 2022 at 6:33

1 Answer 1

1

You can use is not null. For eg:

select *
from input
where meter_totalcycleenergy is not null
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.