First time with RhinoETL, but I've looked at all the Unit Tests and
the video. We really could use an example that does a input file
joined with a lookup table on a DB. I think this has to be a really
common situation.
That is my case at least :D
Left = Customer, Right = product lookup, Looking to do this in sql
syntax
Select c.*,mm.Product_ID from
Customer c
Left outer join ModelMaster mm on c.Item_No = mm.Model_No
Here's what I have
PortfolioRecord - has all the fields, plus some [FieldIgnored],
including ProductId
PortfolioRecord - same as above, but no ignored fields
PortfolioReadOperation:AbstractOperation - works
ModelMasterReadOperation:InputCommandOperation- seems to work
Then here is the JoinModelMasterOperation:NestedLoopsJoinOperation
public class JoinModelMasterOperation : NestedLoopsJoinOperation
{
protected override Row MergeRows(Row leftRow, Row rightRow)
{
Row row = leftRow.Clone();
row["ITEM_NUM"] = rightRow["MODEL_NO"];
return row;
}
protected override bool MatchJoinCondition(Row leftRow, Row
rightRow)
{
return Equals(leftRow["ITEM_NUM"], rightRow["MODEL_NO"])
|| rightRow["MODEL_NO"] == null;
}
}
Then for the execution,
Register ( new JoinModelMasterOperation()
.Left( new
PortfolioReadOperation(inputFile) )
.Right( new
ModelMasterReadOperation("AftermarketDb") )
);
Register(new
PortfolioWriteToFileOperation(Path.Combine(Settings.Default.OutputFilePath,
"TestOutput.txt")));
I expect about an 80% match, but I never get the ModelMaster.ProductId
in the output. Any idea what I am missing here?
Thanks for your time.
Larry
--
You received this message because you are subscribed to the Google Groups
"Rhino Tools Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rhino-tools-dev?hl=en.