Search in sources :

Example 1 with ProcedureRegistry

use of io.trino.metadata.ProcedureRegistry in project trino by trinodb.

the class TestCallTask method executeCallTask.

private void executeCallTask(MethodHandle methodHandle, Function<TransactionManager, AccessControl> accessControlProvider) {
    TransactionManager transactionManager = queryRunner.getTransactionManager();
    ProcedureRegistry procedureRegistry = createProcedureRegistry(new Procedure("test", "testing_procedure", ImmutableList.of(), methodHandle));
    AccessControl accessControl = accessControlProvider.apply(transactionManager);
    PlannerContext plannerContext = plannerContextBuilder().withTransactionManager(transactionManager).build();
    new CallTask(transactionManager, plannerContext, accessControl, procedureRegistry).execute(new Call(QualifiedName.of("testing_procedure"), ImmutableList.of()), stateMachine(transactionManager, plannerContext.getMetadata(), accessControl), ImmutableList.of(), WarningCollector.NOOP);
}
Also used : Call(io.trino.sql.tree.Call) PlannerContext(io.trino.sql.PlannerContext) TransactionManager(io.trino.transaction.TransactionManager) ProcedureRegistry(io.trino.metadata.ProcedureRegistry) Procedure(io.trino.spi.procedure.Procedure) AllowAllAccessControl(io.trino.security.AllowAllAccessControl) DenyAllAccessControl(io.trino.security.DenyAllAccessControl) ConnectorAccessControl(io.trino.spi.connector.ConnectorAccessControl) AccessControl(io.trino.security.AccessControl) AllowAllSystemAccessControl(io.trino.plugin.base.security.AllowAllSystemAccessControl)

Example 2 with ProcedureRegistry

use of io.trino.metadata.ProcedureRegistry in project trino by trinodb.

the class TestCallTask method createProcedureRegistry.

private static ProcedureRegistry createProcedureRegistry(Procedure procedure) {
    ProcedureRegistry procedureRegistry = new ProcedureRegistry();
    procedureRegistry.addProcedures(new CatalogName("test"), ImmutableList.of(procedure));
    return procedureRegistry;
}
Also used : ProcedureRegistry(io.trino.metadata.ProcedureRegistry) CatalogName(io.trino.connector.CatalogName)

Aggregations

ProcedureRegistry (io.trino.metadata.ProcedureRegistry)2 CatalogName (io.trino.connector.CatalogName)1 AllowAllSystemAccessControl (io.trino.plugin.base.security.AllowAllSystemAccessControl)1 AccessControl (io.trino.security.AccessControl)1 AllowAllAccessControl (io.trino.security.AllowAllAccessControl)1 DenyAllAccessControl (io.trino.security.DenyAllAccessControl)1 ConnectorAccessControl (io.trino.spi.connector.ConnectorAccessControl)1 Procedure (io.trino.spi.procedure.Procedure)1 PlannerContext (io.trino.sql.PlannerContext)1 Call (io.trino.sql.tree.Call)1 TransactionManager (io.trino.transaction.TransactionManager)1