Search in sources :

Example 1 with ClusterType

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));
    }
}
Also used : QueryObjectBundle(com.facebook.presto.verifier.framework.QueryObjectBundle) ClusterType(com.facebook.presto.verifier.framework.ClusterType)

Aggregations

ClusterType (com.facebook.presto.verifier.framework.ClusterType)1 QueryObjectBundle (com.facebook.presto.verifier.framework.QueryObjectBundle)1