use of com.facebook.presto.sql.parser.SqlParser in project presto by prestodb.
the class TestReorderWindows method assertUnitPlan.
private void assertUnitPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getMetadata().getFunctionAndTypeManager()), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), new TranslateExpressions(getQueryRunner().getMetadata(), new SqlParser()).rules()), new PredicatePushDown(getMetadata(), getQueryRunner().getSqlParser()), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections(), new GatherAndMergeWindows.SwapAdjacentWindowsBySpecifications(0), new GatherAndMergeWindows.SwapAdjacentWindowsBySpecifications(1), new GatherAndMergeWindows.SwapAdjacentWindowsBySpecifications(2))), new PruneUnreferencedOutputs());
assertPlan(sql, pattern, optimizers);
}
use of com.facebook.presto.sql.parser.SqlParser in project presto by prestodb.
the class PlanBuilder method rowExpression.
public RowExpression rowExpression(String sql) {
Expression expression = expression(sql);
Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes(session, metadata, new SqlParser(), getTypes(), expression, ImmutableList.of(), WarningCollector.NOOP);
return SqlToRowExpressionTranslator.translate(expression, expressionTypes, ImmutableMap.of(), metadata.getFunctionAndTypeManager(), session);
}
use of com.facebook.presto.sql.parser.SqlParser in project presto by prestodb.
the class TestEliminateSorts method assertUnitPlan.
public void assertUnitPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
List<PlanOptimizer> optimizers = ImmutableList.of(new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), new TranslateExpressions(getMetadata(), new SqlParser()).rules()), new AddExchanges(getQueryRunner().getMetadata(), new SqlParser(), new PartitioningProviderManager()), new UnaliasSymbolReferences(getMetadata().getFunctionAndTypeManager()), new PruneUnreferencedOutputs(), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections())));
assertPlan(sql, pattern, optimizers);
}
Aggregations