I can do it in a UDSO :
public sealed class PromoIdsToEvents : CepPointStreamOperator<string, int>
{
public override IEnumerable<int> ProcessEvent(PointEvent<string> inputEvent)
{
if (inputEvent.Payload.Length > 0)
{
string[] separator = new[] { "," };
string[] idStrings = inputEvent.Payload.Split(separator, StringSplitOptions.RemoveEmptyEntries);
foreach (var p in idStrings)
{
yield return int.Parse(p);
}
}
}
public override bool IsEmpty
{
get { return false; }
}
}
Is it possible to do it all in a query? All this does is make an IEnumberable :
var multipleEventsAsInts = from c in csvEvents
let split = c.Split(',').Select(int.Parse)
select split;
You might be able to do this work in a subject, but I think the way you are doing it, through a UDSO is the proper way to work with a StreamInsight event in a procedural manner.
By creating that UDSO, you now have a reusable chunk of code. If you just did that work in the query logic, you wouldn't have the ability to re-use it as easily.