" SELECT 'abc' as col2a FROM lineitem limit 1000000\n" +
" ) table2\n" +
" ON table1.col1a = table2.col2a\n" +
" WHERE rand() * 1000 > table1.col1b\n" +
")");
MaterializedTuple tuple = Iterables.getOnlyElement(materializedResult.getMaterializedTuples());
Assert.assertEquals(tuple.getFieldCount(), 1);
long count = (Long) tuple.getField(0);
// Technically non-deterministic unit test but has essentially a next to impossible chance of a false positive
Assert.assertTrue(count > 0 && count < 1000000);
}