-
Notifications
You must be signed in to change notification settings - Fork 7
Fb dataset update rewrite #6552
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
base: develop
Are you sure you want to change the base?
Conversation
WARNING: This PR appears to have the default title generated by GitHub. Please use something more descriptive. |
WARNING: This PR appears to have the default title generated by GitHub. Please use something more descriptive. |
@mbellew I'm going to need your opinion on the test failure I'm seeing in It also looks like other data types don't support this on update either. Do you think the old behavior is still required, should there be code in |
return null; | ||
|
||
Object o = it.get(i); | ||
if (null == o) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JdbcType.DOUBLE.convert(o)
return null; | ||
|
||
Object o = it.get(i); | ||
return null == o ? "" : o.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Objects.toString(o,"")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look good to go
try (DbScope.Transaction transaction = StudyService.get().getDatasetSchema().getScope().ensureTransaction()) | ||
{ | ||
String lsid = keyFromMap(oldRow); | ||
checkDuplicateUpdate(lsid);// Make sure we've found the original participant before doing the update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is for the next line, not checkDuplicateUpdate
, a merge error I believe.
Rationale
Dataset
updateRows
had previously been implemented as a single row delete followed by an insert row. This PR attempts to rewrite this code to look like more typicalQueryUpdateService.updateRow
implementations.This work was focused on a few main areas and tasks:
DatasetDataIteratorBuilder
so they could be used outside of aDataIterator
context. These helpers were responsible for : LSID, subject ID, sequence number, and participant sequence number generation.DatasetDataIteratorBuilder
DatasetUpdateService.updateRow
to use the new helpers as well asTable.update
to update the row.