if (results.getUpdateCount().isPresent()) { if (!count.isPresent()) { fail("update count should not be present"); assertEquals(results.getUpdateCount().getAsLong(), count.getAsLong(), "update count");
if (actualResults.getUpdateType().isPresent() || actualResults.getUpdateCount().isPresent()) { if (!actualResults.getUpdateType().isPresent()) { fail("update count present without update type for query: \n" + actual); fail("update type not present for query: \n" + actual); if (!actualResults.getUpdateCount().isPresent()) { fail("update count not present for query: \n" + actual); MaterializedRow row = expectedRows.get(0); assertEquals(row.getFieldCount(), 1, "For query: \n " + actual + "\n:"); assertEquals(row.getField(0), actualResults.getUpdateCount().getAsLong(), "For query: \n " + actual + "\n:");
LOG.info("%s", sql); long start = System.nanoTime(); long rows = queryRunner.execute(session, sql).getUpdateCount().getAsLong(); LOG.info("Imported %s rows for %s in %s", rows, target, nanosSince(start));
if (results.getUpdateCount().isPresent()) { if (!count.isPresent()) { fail("update count should not be present"); assertEquals(results.getUpdateCount().getAsLong(), count.getAsLong(), "update count");
if (actualResults.getUpdateType().isPresent() || actualResults.getUpdateCount().isPresent()) { if (!actualResults.getUpdateType().isPresent()) { fail("update count present without update type for query: \n" + actual); fail("update type not present for query: \n" + actual); if (!actualResults.getUpdateCount().isPresent()) { fail("update count not present for query: \n" + actual); MaterializedRow row = expectedRows.get(0); assertEquals(row.getFieldCount(), 1, "For query: \n " + actual + "\n:"); assertEquals(row.getField(0), actualResults.getUpdateCount().getAsLong(), "For query: \n " + actual + "\n:");