Join Conditions
-
2011년 12월 25일 일요일 오후 6:20
Since we can not use the on new {left.fieldA, left.fieldB} equals new {right.fieldA, right.fieldB} syntax, is it ok to do this?
from ka in kursanpassungQuery join lvl2Bid in quoteLevelTicksFromBloomberg on ka.OrderStatus.Isin equals lvl2Bid.Isin where lvl2Bid.Exchange == ka.PrimaryExchangeId && lvl2Bid.Level == 2 && lvl2Bid.Type == QuoteTickType.LevelBid

모든 응답
-
2011년 12월 27일 화요일 오전 7:47중재자
Hi Stylus.vb,
It looks OK. You need to test it on your environment by yourself.
Best Regards,
Peja
Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.- 답변으로 표시됨 Peja TaoModerator 2012년 1월 16일 월요일 오전 1:18
-
2012년 1월 3일 화요일 오후 3:09
Yes, you can use new{left.fieldA, left.fieldB} equals {right.fieldA, right.fieldB} ... at least in version 1.2. What version of StreamInsight are you using?
Where you may have an issue is with an enum (assuming that QuoteTickType.LevelBid is an enum) ... StreamInsight doesn't support enumerations. Instead, I typically declare as an int and have the value as a constant. You'll get the same "look" from a syntax perspective when doing straight comparisons although it isn't quite the same, especially with bitmask (flags) enumerations.
That said, when I am joining using where conditions as opposed to a join statement, I will typically place each where clause individually on a separate line ... the result is no different but I find it a bit clearer.
from ka in kursanpassungQuery from lvl2Bid in quoteLevelTicksFromBloomberg where ka.OrderStatus.Isin == lvl2Bid.Isin where lvl2Bid.Exchange == ka.PrimaryExchangeId where lvl2Bid.Level == 2 where lvl2Bid.Type == QuoteTickType.LevelBid
DevBiker (aka J Sawyer)
My Blog
My Bike - Concours 14
If I answered your question, please mark as answer.
If my post was helpful, please mark as helpful.- 답변으로 표시됨 Peja TaoModerator 2012년 1월 16일 월요일 오전 1:18

