use of com.facebook.presto.verifier.framework.ClusterType in project presto by prestodb.
the class TestQueryRewriter method assertShadowed.
private void assertShadowed(QueryRewriter queryRewriter, @Language("SQL") String query, String prefix, List<String> expectedSetupTemplates, @Language("SQL") String expectedTemplates, List<String> expectedTeardownTemplates) {
for (ClusterType cluster : ClusterType.values()) {
QueryObjectBundle bundle = queryRewriter.rewriteQuery(query, cluster);
String tableName = bundle.getObjectName().toString();
assertTrue(tableName.startsWith(prefix + "_"));
assertStatements(bundle.getSetupQueries(), templateToStatements(expectedSetupTemplates, tableName));
assertStatements(ImmutableList.of(bundle.getQuery()), templateToStatements(ImmutableList.of(expectedTemplates), tableName));
assertStatements(bundle.getTeardownQueries(), templateToStatements(expectedTeardownTemplates, tableName));
}
}
Aggregations