use of io.prestosql.spi.WarningCode in project hetu-core by openlookeng.
the class TestCompletedEventWarnings method assertWarnings.
private void assertWarnings(@Language("SQL") String sql, Map<String, String> sessionProperties, List<WarningCode> expectedWarnings) throws InterruptedException {
// Task concurrency must be 1 otherwise these tests fail due to change in the number of EXPECTED_EVENTS
SessionBuilder sessionBuilder = testSessionBuilder().setSystemProperty("task_concurrency", "1");
sessionProperties.forEach(sessionBuilder::setSystemProperty);
queryRunner.execute(sessionBuilder.build(), sql);
generatedEvents.waitForEvents(10);
Set<WarningCode> warnings = getOnlyElement(generatedEvents.getQueryCompletedEvents()).getWarnings().stream().map(PrestoWarning::getWarningCode).collect(toImmutableSet());
for (WarningCode warningCode : expectedWarnings) {
if (!warnings.contains(warningCode)) {
fail("Expected warning: " + warningCode);
}
}
}
Aggregations