use of com.facebook.presto.sql.relational.RowExpressionOptimizer in project presto by prestodb.
the class CommonSubExpressionBenchmark method rowExpression.
private RowExpression rowExpression(String value) {
Expression expression = createExpression(value, METADATA, TypeProvider.copyOf(symbolTypes));
Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes(TEST_SESSION, METADATA, SQL_PARSER, TypeProvider.copyOf(symbolTypes), expression, emptyList(), WarningCollector.NOOP);
RowExpression rowExpression = SqlToRowExpressionTranslator.translate(expression, expressionTypes, sourceLayout, METADATA.getFunctionAndTypeManager(), TEST_SESSION);
RowExpressionOptimizer optimizer = new RowExpressionOptimizer(METADATA);
return optimizer.optimize(rowExpression, OPTIMIZED, TEST_SESSION.toConnectorSession());
}
use of com.facebook.presto.sql.relational.RowExpressionOptimizer in project presto by prestodb.
the class PageProcessorBenchmark method rowExpression.
private RowExpression rowExpression(String value) {
Expression expression = createExpression(value, METADATA, TypeProvider.copyOf(symbolTypes));
Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes(TEST_SESSION, METADATA, SQL_PARSER, TypeProvider.copyOf(symbolTypes), expression, emptyList(), WarningCollector.NOOP);
RowExpression rowExpression = SqlToRowExpressionTranslator.translate(expression, expressionTypes, sourceLayout, METADATA.getFunctionAndTypeManager(), TEST_SESSION);
RowExpressionOptimizer optimizer = new RowExpressionOptimizer(METADATA);
return optimizer.optimize(rowExpression, OPTIMIZED, TEST_SESSION.toConnectorSession());
}
use of com.facebook.presto.sql.relational.RowExpressionOptimizer in project presto by prestodb.
the class TestingRowExpressionTranslator method translateAndOptimize.
public RowExpression translateAndOptimize(Expression expression, Map<NodeRef<Expression>, Type> types) {
RowExpression rowExpression = SqlToRowExpressionTranslator.translate(expression, types, ImmutableMap.of(), metadata.getFunctionAndTypeManager(), TEST_SESSION);
RowExpressionOptimizer optimizer = new RowExpressionOptimizer(metadata);
return optimizer.optimize(rowExpression, OPTIMIZED, TEST_SESSION.toConnectorSession());
}
Aggregations