use of com.facebook.presto.verifier.rewrite.VerificationQueryRewriterFactory 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();
}
Aggregations