Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Commit

Permalink
Made ObjectCreation.FieldCopy lenient for MissingNodes to support out…
Browse files Browse the repository at this point in the history
…er joins better
  • Loading branch information
arvid committed Jan 17, 2014
1 parent a7a491e commit b197add
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ public void shouldPerformFullOuterTwoSourceJoin() {
}

@Test
@Ignore
public void shouldPerformFullOuterTwoSourceJoin2() {
final SopremoTestPlan sopremoPlan = new SopremoTestPlan(2, 1);

Expand All @@ -206,7 +205,6 @@ public void shouldPerformFullOuterTwoSourceJoin2() {
new ObjectCreation.CopyFields(new InputSelection(1)),
new ObjectCreation.FieldAssignment("worksFor", JsonUtil.createPath("0", "worksFor"))));
join.setInputs(sopremoPlan.getInputOperators(0, 2));
join.setResultProjection(ObjectCreation.CONCATENATION);
sopremoPlan.getOutputOperator(0).setInputs(join);
sopremoPlan.getInput(0).
addObject("biographyId", "A000029", "worksFor", "CompanyXYZ").
Expand All @@ -219,10 +217,9 @@ public void shouldPerformFullOuterTwoSourceJoin2() {
sopremoPlan.getExpectedOutput(0).
addObject("biography", "A000029", "id", "usCongress1", "income", 1, "name", "Andrew Adams", "worksFor",
"CompanyXYZ").
addObject("biography", "A000039", "id", "usCongress2", "income", 1, "name", "John Adams", "worksFor",
"CompanyUVW").
addObject("biography", "A000049", "worksFor", "CompanyABC").
addObject("biography", "A000059", "id", "usCongress3", "income", 1, "name", "Andrew Adams");
addObject("biography", "A000039", "id", "usCongress2", "income", 1, "name", "John Adams").
addObject("worksFor", "CompanyABC").
addObject("biography", "A000059", "id", "usCongress3", "income", 1, "name", "John Doe", "worksFor", "CompanyUVW");

sopremoPlan.trace();
sopremoPlan.run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ public PathSegmentExpression getTargetExpression() {
@Override
protected void evaluate(final IJsonNode node, final IObjectNode target) {
final IJsonNode exprNode = this.getExpression().evaluate(node);
target.putAll((IObjectNode) exprNode);
if (!(exprNode instanceof MissingNode))
target.putAll((IObjectNode) exprNode);
}
}

Expand Down

0 comments on commit b197add

Please sign in to comment.