Package io.trino.testing
Class LocalQueryRunner
- java.lang.Object
-
- io.trino.testing.LocalQueryRunner
-
- All Implemented Interfaces:
QueryRunner,Closeable,AutoCloseable
public class LocalQueryRunner extends Object implements QueryRunner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLocalQueryRunner.Builderstatic interfaceLocalQueryRunner.PlanOptimizersProvider-
Nested classes/interfaces inherited from interface io.trino.testing.QueryRunner
QueryRunner.MaterializedResultWithPlan
-
-
Method Summary
-
-
-
Method Detail
-
create
public static LocalQueryRunner create(Session defaultSession)
-
builder
public static LocalQueryRunner.Builder builder(Session defaultSession)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceQueryRunner
-
loadEventListeners
public void loadEventListeners()
-
getNodeCount
public int getNodeCount()
- Specified by:
getNodeCountin interfaceQueryRunner
-
getCatalogManager
public CatalogManager getCatalogManager()
-
getTransactionManager
public TransactionManager getTransactionManager()
- Specified by:
getTransactionManagerin interfaceQueryRunner
-
getSqlParser
public SqlParser getSqlParser()
-
getMetadata
public Metadata getMetadata()
- Specified by:
getMetadatain interfaceQueryRunner
-
getTypeOperators
public TypeOperators getTypeOperators()
-
getBlockTypeOperators
public BlockTypeOperators getBlockTypeOperators()
-
getNodePartitioningManager
public NodePartitioningManager getNodePartitioningManager()
- Specified by:
getNodePartitioningManagerin interfaceQueryRunner
-
getPageSourceManager
public PageSourceManager getPageSourceManager()
- Specified by:
getPageSourceManagerin interfaceQueryRunner
-
getSplitManager
public SplitManager getSplitManager()
- Specified by:
getSplitManagerin interfaceQueryRunner
-
getStatsCalculator
public StatsCalculator getStatsCalculator()
- Specified by:
getStatsCalculatorin interfaceQueryRunner
-
getCostCalculator
public CostCalculator getCostCalculator()
-
getEstimatedExchangesCostCalculator
public CostCalculator getEstimatedExchangesCostCalculator()
-
getGroupProvider
public TestingGroupProvider getGroupProvider()
- Specified by:
getGroupProviderin interfaceQueryRunner
-
getAccessControl
public TestingAccessControlManager getAccessControl()
- Specified by:
getAccessControlin interfaceQueryRunner
-
getExecutor
public ExecutorService getExecutor()
-
getScheduler
public ScheduledExecutorService getScheduler()
-
getDefaultSession
public Session getDefaultSession()
- Specified by:
getDefaultSessionin interfaceQueryRunner
-
getExpressionCompiler
public ExpressionCompiler getExpressionCompiler()
-
createCatalog
public void createCatalog(String catalogName, ConnectorFactory connectorFactory, Map<String,String> properties)
-
installPlugin
public void installPlugin(Plugin plugin)
- Specified by:
installPluginin interfaceQueryRunner
-
addFunctions
public void addFunctions(List<? extends SqlFunction> functions)
- Specified by:
addFunctionsin interfaceQueryRunner
-
createCatalog
public void createCatalog(String catalogName, String connectorName, Map<String,String> properties)
- Specified by:
createCatalogin interfaceQueryRunner
-
printPlan
public LocalQueryRunner printPlan()
-
listTables
public List<QualifiedObjectName> listTables(Session session, String catalog, String schema)
- Specified by:
listTablesin interfaceQueryRunner
-
tableExists
public boolean tableExists(Session session, String table)
- Specified by:
tableExistsin interfaceQueryRunner
-
execute
public MaterializedResult execute(String sql)
- Specified by:
executein interfaceQueryRunner
-
execute
public MaterializedResult execute(Session session, String sql)
- Specified by:
executein interfaceQueryRunner
-
executeWithPlan
public QueryRunner.MaterializedResultWithPlan executeWithPlan(Session session, String sql, WarningCollector warningCollector)
- Specified by:
executeWithPlanin interfaceQueryRunner
-
inTransaction
public <T> T inTransaction(Session session, Function<Session,T> transactionSessionConsumer)
-
getExclusiveLock
public Lock getExclusiveLock()
- Specified by:
getExclusiveLockin interfaceQueryRunner
-
createDrivers
public List<Driver> createDrivers(String sql, OutputFactory outputFactory, TaskContext taskContext)
-
createDrivers
public List<Driver> createDrivers(Session session, String sql, OutputFactory outputFactory, TaskContext taskContext)
-
createPlan
public Plan createPlan(Session session, String sql, WarningCollector warningCollector)
- Specified by:
createPlanin interfaceQueryRunner
-
createPlan
public Plan createPlan(Session session, String sql, LogicalPlanner.Stage stage, WarningCollector warningCollector)
-
createPlan
public Plan createPlan(Session session, String sql, LogicalPlanner.Stage stage, boolean forceSingleNode, WarningCollector warningCollector)
-
getPlanOptimizers
public List<PlanOptimizer> getPlanOptimizers(boolean forceSingleNode)
-
createPlan
public Plan createPlan(Session session, String sql, List<PlanOptimizer> optimizers, WarningCollector warningCollector)
-
createPlan
public Plan createPlan(Session session, String sql, List<PlanOptimizer> optimizers, LogicalPlanner.Stage stage, WarningCollector warningCollector)
-
-