locked
Stream Analytics processing using EventHub partition key in Analytics query. RRS feed

  • Question

  • Hi , 

    Can i use Event-Hub Partition Key in the query?

    I have a scenario where i send 3 types of messages to the same Event-Hub instance using Partition Key as identifier . I can fetch the data from eventhub using client code and save the result in the different tables by using Partition Key as a differentiator.  Can i do the same in Stream Analytics where i can write a query that looks something like this:

    Select * into [OutputTable] from [InputSource] where PartitionKey ="someKey" .

    Thursday, May 7, 2015 11:55 AM

Answers

  • You need to provide the PartitionKey value in your event payload for this query to work. Event Hub PartitionKey is not a part of the payload by default.
    • Marked as answer by Zafar Abbas Tuesday, May 12, 2015 5:36 AM
    Sunday, May 10, 2015 5:20 AM

All replies

  • Is "PartitionKey" column defined in your create table ?

    [Disclaimer] This posting is provided "AS IS" with no warranties, and confers no rights. User assumes all.

    Thursday, May 7, 2015 2:17 PM
  • No , This is the Event-Hub Partition Key property . I want to store data from a particular partition. 
    Thursday, May 7, 2015 2:20 PM
  • In ASA, there is a "PartitionId" (metadata column added to every output event) which is a zero-based partition ID for the Event Hub input adapter. It can be used in a where clause , and you can use "Partition by PartitionId" clause if you want your processing also partitioned by the same.

    More details here -- http://azure.microsoft.com/en-us/documentation/articles/stream-analytics-developer-guide/


    [Disclaimer] This posting is provided "AS IS" with no warranties, and confers no rights. User assumes all.

    Thursday, May 7, 2015 11:25 PM
  • You need to provide the PartitionKey value in your event payload for this query to work. Event Hub PartitionKey is not a part of the payload by default.
    • Marked as answer by Zafar Abbas Tuesday, May 12, 2015 5:36 AM
    Sunday, May 10, 2015 5:20 AM