microsoft / Trill

Trill is a single-node query processor for temporal or streaming data.
MIT License
1.24k stars 133 forks source link

MissingMethodException when using QueryContainer() #133

Open cernuto opened 4 years ago

cernuto commented 4 years ago

When using query container the following exception is thrown when using aggregate extension method:

System.MissingMethodException: 'Method not found: 'Void Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions

Here is the query:

var eventToSend = _eventInputStream.Multicast(ev => { return ev.Join(_meterInputStream, (evt, mtr) => new { evt, mtr }) .AlterEventDuration(StreamEvent.InfinitySyncTime) .ClipEventDuration(_eventAckInputStream, evtMtr => evtMtr.evt.Id, evtAck => evtAck.Id) .Join(ev, (evtMtr, evt) => evtMtr) .GroupApply(evtMtr => evtMtr.mtr.Key, em => em.Min((eml, emr) => eml.mtr.DateTime.Ticks.CompareTo(emr.mtr.DateTime.Ticks))); });

When .Min() is removed it will not throw. Also, when not using a QueryContainer() it will not throw.

Is it due to incompatible versions or wrong version installed?

cernuto commented 4 years ago

A careful application of Multicast has fixed the issue

var eventToSend = _eventInputStream.Multicast(ev => { return ev.Join(_meterInputStream, (evt, mtr) => new { evt, mtr }) .AlterEventDuration(StreamEvent.InfinitySyncTime) .ClipEventDuration(_eventAckInputStream, evtMtr => evtMtr.evt.Id, evtAck => evtAck.Id) .Join(ev, (evtMtr, evt) => evtMtr) .Multicast(evtMtr => evtMtr.Min(em => em.evt.Id).Join(evtMtr, l => l, r => r.evt.Id, (e, m) => new { e, m })); });

I imagine this is a more efficient way to do the query. Now, if someone could post examples of Pivot and Unpivot?