Skip to content

Commit

Permalink
skipping over null samplesets
Browse files Browse the repository at this point in the history
  • Loading branch information
David M Sibley committed Apr 13, 2015
1 parent 8be1636 commit 77215b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,20 @@ protected void addNextRow() throws SQLException {

while(0 >= result.size() && in.next() && !in.isAfterLast()) {
TableRow now = TableRow.buildTableRow(in);
queuedRows.add(now);
if (null == sampleSet) {
sampleSet = queuedRows.peek().getValue(sampleSetColumn);
}

if (null != sampleSet &&
(queuedRows.size() > 1 && !sampleSet.equals(queuedRows.peekLast().getValue(sampleSetColumn)))) {
TableRow averagedRow = flushNextSampleSet();
if (null != averagedRow) {
result.add(averagedRow);
if (null != now.getValue(sampleSetColumn)) { // skip over null samplesets
queuedRows.add(now);
if (null == sampleSet) {
sampleSet = queuedRows.peek().getValue(sampleSetColumn);
}

if (null != sampleSet &&
(queuedRows.size() > 1 && !sampleSet.equals(queuedRows.peekLast().getValue(sampleSetColumn)))) {
TableRow averagedRow = flushNextSampleSet();
if (null != averagedRow) {
result.add(averagedRow);
}
sampleSet = null;
}
sampleSet = null;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ public static void setUpClass() throws Exception {
}));
expectedGCMON296Dataset = ResultSetUtils.createTableRows(expectedGCMON296ColGroup, new String[][] {
new String[] {"" + dtf.parseDateTime("2010-11-08T15:10:00-07:00").getMillis(),"1","0.352","1453.63","0.0369","0.0720"},
new String[] {"" + dtf.parseDateTime("2010-11-08T15:20:00-07:00").getMillis(),null,"0.119","488.06",null,null},
new String[] {"" + dtf.parseDateTime("2012-01-17T16:25:00-07:00").getMillis(),null,"0.112","425.96",null,null},
// new String[] {"" + dtf.parseDateTime("2010-11-08T15:20:00-07:00").getMillis(),null,"0.119","488.06",null,null},
// new String[] {"" + dtf.parseDateTime("2012-01-17T16:25:00-07:00").getMillis(),null,"0.112","425.96",null,null},
new String[] {"" + dtf.parseDateTime("2012-01-17T16:35:00-07:00").getMillis(),"2","0.192","292.99","0.0221","0.0431"},
new String[] {"" + dtf.parseDateTime("2012-10-09T14:05:00-07:00").getMillis(),"3","0.306","193.03","0.0093","0.0181"},
});
Expand Down

0 comments on commit 77215b5

Please sign in to comment.