Skip to content

TargetMapper behavior has changed #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aletr opened this issue Jan 31, 2020 · 0 comments
Open

TargetMapper behavior has changed #176

aletr opened this issue Jan 31, 2020 · 0 comments

Comments

@aletr
Copy link

aletr commented Jan 31, 2020

TargetMapper behavior has changed. In the version without a DataFrame, com.nhl.link.move.runtime.task.createorupdate.TargetMapper#map throws an exception with the message like "Invalid key: " if duplicates were in the data source.

But in the version with a DataFrame, we can load duplicates in targed without any error messages.

In addition, even if we delete duplicates from the data source, duplicates will not be deleted from the target.

public DataFrame map(
ObjectContext context,
DataFrame sources,
DataFrame targets) {
Hasher lkm = r -> r.get(CreateOrUpdateSegment.KEY_COLUMN);
Hasher rkm = r -> mapper.keyForTarget((DataObject) r.get(CreateOrUpdateSegment.TARGET_COLUMN));
return sources
.leftJoin().on(lkm, rkm).with(targets)
.addColumn(CreateOrUpdateSegment.TARGET_CREATED_COLUMN, r -> isCreated(r.get(CreateOrUpdateSegment.TARGET_COLUMN)))
.convertColumn(CreateOrUpdateSegment.TARGET_COLUMN, r -> createIfMissing(r, context));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant