locked
no TumblingWindow timestamp provided for COUNT(*) - only key and value RRS feed

  • Question

  • Hello Community!

    I have a real case which is similar to 'Query example: Send data to multiple outputs' in ASA Common Query Patterns. Especially output #2

    I need to retrieve the column name (key from the JSON input), number of times it occurred in the last 15 minutes, and the time of the end of the TumblingWindow.

    I am only getting the column name and the number of times it occurred (like Toyota 3 in the mentioned example) but no end of TumblingWindow time. What am I missing?

    Here's my query:

    SELECT
        COUNT(guest) AS GUESTS
    INTO
        [output]
    FROM
        [input] TIMESTAMP BY tm_stmp
    GROUP BY
        TumblingWindow(minute, 15)

    ----

    Counting works fine.

    Where tm_stmp is a timestamp that the event was generated at source. It doesn't matter whether I use this or eventhub processing/entry timestamps.

    Regards,

    Miro

    Thursday, December 14, 2017 7:14 PM

Answers

  • You can use `System.Timestamp` to get the window end. Like:

    SELECT
    System.Timestamp AS WindowEnd,
        COUNT(guest) AS GUESTS
    INTO
        [output]
    FROM
        [input] TIMESTAMP BY tm_stmp
    GROUP BY TumblingWindow(minute, 15)


    Azure Stream Analytics.

    • Marked as answer by Miro Polski Thursday, December 14, 2017 9:40 PM
    Thursday, December 14, 2017 8:08 PM