Search in sources :

Example 1 with QueryRewriteConfig

use of com.facebook.presto.verifier.rewrite.QueryRewriteConfig in project presto by prestodb.

the class AbstractVerificationTest method verify.

private Optional<VerifierQueryEvent> verify(SourceQuery sourceQuery, boolean explain, Optional<PrestoAction> mockPrestoAction) {
    VerifierConfig verifierConfig = new VerifierConfig().setTestId(TEST_ID).setExplain(explain);
    TypeManager typeManager = createTypeManager();
    PrestoAction prestoAction = mockPrestoAction.orElseGet(() -> getPrestoAction(Optional.of(sourceQuery.getControlConfiguration())));
    QueryRewriterFactory queryRewriterFactory = new VerificationQueryRewriterFactory(sqlParser, typeManager, new QueryRewriteConfig().setTablePrefix(CONTROL_TABLE_PREFIX), new QueryRewriteConfig().setTablePrefix(TEST_TABLE_PREFIX));
    VerificationFactory verificationFactory = new VerificationFactory(sqlParser, (source, context) -> new QueryActions(prestoAction, prestoAction, prestoAction), queryRewriterFactory, failureResolverManagerFactory, createChecksumValidator(verifierConfig), exceptionClassifier, verifierConfig, typeManager, determinismAnalyzerConfig);
    return verificationFactory.get(sourceQuery, Optional.empty()).run().getEvent();
}
Also used : QueryRewriteConfig(com.facebook.presto.verifier.rewrite.QueryRewriteConfig) QueryActions(com.facebook.presto.verifier.prestoaction.QueryActions) JdbcPrestoAction(com.facebook.presto.verifier.prestoaction.JdbcPrestoAction) PrestoAction(com.facebook.presto.verifier.prestoaction.PrestoAction) TypeManager(com.facebook.presto.common.type.TypeManager) VerifierTestUtil.createTypeManager(com.facebook.presto.verifier.VerifierTestUtil.createTypeManager) VerificationQueryRewriterFactory(com.facebook.presto.verifier.rewrite.VerificationQueryRewriterFactory) VerificationQueryRewriterFactory(com.facebook.presto.verifier.rewrite.VerificationQueryRewriterFactory) QueryRewriterFactory(com.facebook.presto.verifier.rewrite.QueryRewriterFactory)

Aggregations

TypeManager (com.facebook.presto.common.type.TypeManager)1 VerifierTestUtil.createTypeManager (com.facebook.presto.verifier.VerifierTestUtil.createTypeManager)1 JdbcPrestoAction (com.facebook.presto.verifier.prestoaction.JdbcPrestoAction)1 PrestoAction (com.facebook.presto.verifier.prestoaction.PrestoAction)1 QueryActions (com.facebook.presto.verifier.prestoaction.QueryActions)1 QueryRewriteConfig (com.facebook.presto.verifier.rewrite.QueryRewriteConfig)1 QueryRewriterFactory (com.facebook.presto.verifier.rewrite.QueryRewriterFactory)1 VerificationQueryRewriterFactory (com.facebook.presto.verifier.rewrite.VerificationQueryRewriterFactory)1