use of io.trino.transaction.TestingTransactionManager in project trino by trinodb.
the class TestExpressionInterpreter method planExpression.
// TODO replace that method with io.trino.sql.ExpressionTestUtils.planExpression
static Expression planExpression(@Language("SQL") String expression) {
return TransactionBuilder.transaction(new TestingTransactionManager(), new AllowAllAccessControl()).singleStatement().execute(TEST_SESSION, transactionSession -> {
Expression parsedExpression = SQL_PARSER.createExpression(expression, createParsingOptions(transactionSession));
parsedExpression = rewriteIdentifiersToSymbolReferences(parsedExpression);
parsedExpression = resolveFunctionCalls(PLANNER_CONTEXT, transactionSession, SYMBOL_TYPES, parsedExpression);
parsedExpression = CanonicalizeExpressionRewriter.rewrite(parsedExpression, transactionSession, PLANNER_CONTEXT, createTestingTypeAnalyzer(PLANNER_CONTEXT), SYMBOL_TYPES);
return parsedExpression;
});
}
Aggregations