Skip to content

Commit

Permalink
Merge branch fix for Issue 1131.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwilmer committed Mar 21, 2013
1 parent 7310a6b commit 1b4d57a
Showing 1 changed file with 10 additions and 7 deletions.
Expand Up @@ -250,14 +250,17 @@ protected boolean isTimestampNewer(Conflict conflict, DatabaseWriter writer, Csv
if (column.getMappedTypeCode() == -101) {
// Get the existingTs with timezone
String existingStr = writer.getTransaction().queryForObject(sql, String.class,
objectValues);
int split = existingStr.lastIndexOf(" ");
existingTs = FormatUtils.parseDate(existingStr.substring(0, split).trim(),
FormatUtils.TIMESTAMP_PATTERNS,
TimeZone.getTimeZone(existingStr.substring(split).trim()));

objectValues);
// If you are in this situation because of an instance where the conflict exists
// because the row doesn't exist, then existing simply needs to be null
if (existingStr != null) {
int split = existingStr.lastIndexOf(" ");
existingTs = FormatUtils.parseDate(existingStr.substring(0, split).trim(),
FormatUtils.TIMESTAMP_PATTERNS,
TimeZone.getTimeZone(existingStr.substring(split).trim()));
}
// Get the loadingTs with timezone
split = loadingStr.lastIndexOf(" ");
int split = loadingStr.lastIndexOf(" ");
loadingTs = FormatUtils.parseDate(loadingStr.substring(0, split).trim(),
FormatUtils.TIMESTAMP_PATTERNS,
TimeZone.getTimeZone(loadingStr.substring(split).trim()));
Expand Down

0 comments on commit 1b4d57a

Please sign in to comment.