bychkov
bychkov

Reputation: 1523

How to check for null Json propery in Azure Stream Analytics query?

We have an input stream of Json events from Event Hub in a following form:

 ...
 { "DeviceId": null, "ReportDateUtc": "2015-05-12T20:57:13.0000000Z", ... },
 { "DeviceId": "device123", "ReportDateUtc": "2015-05-12T20:57:13.0000000Z", ... }
 ...

When I test-run the following query, the output record count is 0:

SELECT
    *
FROM
    [events-input]
WHERE DeviceId IS NULL

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

Upvotes: 0

Views: 1335

Answers (1)

Konstantin Zoryn
Konstantin Zoryn

Reputation: 621

There is a bug in the in-portal debugging experience where NULL values are not handled correctly. This will be fixed soon.

If you start actual job it will properly.

Upvotes: 3

Related Questions