microsoft / Trill

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

Question on payload representation value assignment in AfaMultiEventListTransformer.cs #24

Closed jthelin closed 5 years ago

jthelin commented 5 years ago

This code below from AfaMultiEventListTransformer.cs looks strange, but I can't quite tell if it is a bug or just a candidate for some code-cleanup?

Is a different payloadRepresentation value supposed to be used if Config.ForceRowBasedExecution == true? Currently both branches of the C ? A : B statement below end up making the same assignment with a new ColumnarRepresentation(typeof(TPayload))

https://github.com/Microsoft/Trill/blob/eaefac3943f76941955f2169d14f92820e58e6f2/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaMultiEventListTransformer.cs#L52-L58

If this code should always assign the same new ColumnarRepresentation, then I can easily submit a PR to simplify and clarify the code down to:

var payloadRepresentation = new ColumnarRepresentation(typeof(TPayload));
badrishc commented 5 years ago

I think we should be in row mode at this point of the code, so it can be simplified as you suggested.

jthelin commented 5 years ago

I created PR #26 to fix this.