use of io.trino.security.AllowAllAccessControl in project trino by trinodb.
the class TestCreateViewTask method executeCreateView.
private ListenableFuture<Void> executeCreateView(QualifiedName viewName, boolean replace) {
Query query = simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("mock_table")));
CreateView statement = new CreateView(viewName, query, replace, Optional.empty(), Optional.empty());
return new CreateViewTask(metadata, new AllowAllAccessControl(), parser, analyzerFactory).execute(statement, queryStateMachine, ImmutableList.of(), WarningCollector.NOOP);
}
use of io.trino.security.AllowAllAccessControl 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;
});
}
use of io.trino.security.AllowAllAccessControl in project trino by trinodb.
the class TestMinimalFunctionality method testTableExists.
@Test
public void testTableExists() {
QualifiedObjectName name = new QualifiedObjectName("redis", "default", tableName);
transaction(queryRunner.getTransactionManager(), new AllowAllAccessControl()).singleStatement().execute(SESSION, session -> {
Optional<TableHandle> handle = queryRunner.getServer().getMetadata().getTableHandle(session, name);
assertTrue(handle.isPresent());
});
}
Aggregations