use of io.prestosql.sql.planner.TypeAnalyzer in project hetu-core by openlookeng.
the class TestExternalFunctionPushDownChecker method validatePlan.
private void validatePlan(PlanNode root) {
getQueryRunner().inTransaction(session -> {
// metadata.getCatalogHandle() registers the catalog for the transaction
session.getCatalog().ifPresent(catalog -> metadata.getCatalogHandle(session, catalog));
new ExternalFunctionPushDownChecker().validate(root, session, metadata, new TypeAnalyzer(new SqlParser(), metadata), TypeProvider.empty(), WarningCollector.NOOP);
return null;
});
}
use of io.prestosql.sql.planner.TypeAnalyzer in project hetu-core by openlookeng.
the class TestSimplifyExpressions method assertSimplifies.
private static void assertSimplifies(String expression, String expected) {
Expression actualExpression = rewriteIdentifiersToSymbolReferences(SQL_PARSER.createExpression(expression));
Expression expectedExpression = rewriteIdentifiersToSymbolReferences(SQL_PARSER.createExpression(expected));
Expression rewritten = rewrite(actualExpression, TEST_SESSION, new PlanSymbolAllocator(booleanSymbolTypeMapFor(actualExpression)), METADATA, LITERAL_ENCODER, new TypeAnalyzer(SQL_PARSER, METADATA));
assertEquals(normalize(rewritten), normalize(expectedExpression));
}
use of io.prestosql.sql.planner.TypeAnalyzer in project hetu-core by openlookeng.
the class TestEliminateSorts method assertUnitPlan.
private void assertUnitPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getQueryRunner().getMetadata()), new AddExchanges(getQueryRunner().getMetadata(), new TypeAnalyzer(new SqlParser(), getQueryRunner().getMetadata()), true), new PruneUnreferencedOutputs(), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections())));
assertPlan(sql, pattern, optimizers);
}
use of io.prestosql.sql.planner.TypeAnalyzer in project hetu-core by openlookeng.
the class TestValidateAggregationsWithDefaultValues method validatePlan.
private void validatePlan(PlanNode root, boolean forceSingleNode) {
getQueryRunner().inTransaction(session -> {
// metadata.getCatalogHandle() registers the catalog for the transaction
session.getCatalog().ifPresent(catalog -> metadata.getCatalogHandle(session, catalog));
new ValidateAggregationsWithDefaultValues(forceSingleNode).validate(root, session, metadata, new TypeAnalyzer(new SqlParser(), metadata), TypeProvider.empty(), WarningCollector.NOOP);
return null;
});
}
use of io.prestosql.sql.planner.TypeAnalyzer in project hetu-core by openlookeng.
the class TestPushPredicateIntoTableScan method setUpBeforeClass.
@BeforeClass
public void setUpBeforeClass() {
pushPredicateIntoTableScan = new PushPredicateIntoTableScan(tester().getMetadata(), new TypeAnalyzer(new SqlParser(), tester().getMetadata()), true);
catalogName = tester().getCurrentConnectorId();
TpchTableHandle nation = new TpchTableHandle("nation", 1.0);
nationTableHandle = new TableHandle(catalogName, nation, TpchTransactionHandle.INSTANCE, Optional.of(new TpchTableLayoutHandle(nation, TupleDomain.all())));
TpchTableHandle orders = new TpchTableHandle("orders", 1.0);
ordersTableHandle = new TableHandle(catalogName, orders, TpchTransactionHandle.INSTANCE, Optional.of(new TpchTableLayoutHandle(orders, TupleDomain.all())));
}
Aggregations