locked
left joining using an adapter. RRS feed

  • Question

  • Given the following adapter based streams:

    var x = CepStream<Report>.Create(
        @"CommonDataStream",
        typeof(TypedInputAdapterFactory),
        inputConfiguration,
        EventShape.Point);
    
    var bStream = x.Where(_ => _.Side == 1);
    var sStream = x.Where(_ => _.Side == 2);
    
    var joinedStream =
        from s in sStream.AlterEventLifetime(
            _ => _.StartTime - TimeSpan.FromMilliseconds(delay),
            _ => _.EndTime - _.StartTime + TimeSpan.FromMilliseconds(delay))
        from b in bStream.AlterEventLifetime(
            _ => _.StartTime - TimeSpan.FromMilliseconds(delay),
            _ => _.EndTime - _.StartTime + TimeSpan.FromMilliseconds(buyDelay))
        where (s.Id == b.Id) &&
              (s.Code == b.Code)
        select new {
            ...
        }

    This query joins the two streams, and correctly produces results.
    I now need to join it to some reference information.

    var extra = this.ClientList.ToEdgeStream(
        application,
        _ => EdgeEvent.CreateStart(today.AddHours(1).AddTicks(1), _),
        AdvanceTimeSettings.IncreasingStartTime,
        "ref").AlterEventDuration(e => TimeSpan.MaxValue);

    How do I achieve a left join to the reference data?

    // how do I left join these streams.

    var query = from result in joinedStream LEFT JOIN extra on { result.ExternalReferenceCode = result.ExternalReferenceCode } select new { result, extra or null }





    • Edited by jim-my Thursday, October 29, 2015 8:47 AM
    Thursday, October 29, 2015 8:46 AM