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);
}
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;
}
Aggregations