Package io.prestosql.testing
Class LocalQueryRunner
- java.lang.Object
-
- io.prestosql.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 class
LocalQueryRunner.Builder
-
Nested classes/interfaces inherited from interface io.prestosql.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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceQueryRunner
-
loadEventListeners
public void loadEventListeners()
-
getNodeCount
public int getNodeCount()
- Specified by:
getNodeCount
in interfaceQueryRunner
-
getTransactionManager
public TransactionManager getTransactionManager()
- Specified by:
getTransactionManager
in interfaceQueryRunner
-
getSqlParser
public SqlParser getSqlParser()
-
getMetadata
public Metadata getMetadata()
- Specified by:
getMetadata
in interfaceQueryRunner
-
getTypeOperators
public TypeOperators getTypeOperators()
-
getBlockTypeOperators
public BlockTypeOperators getBlockTypeOperators()
-
getNodePartitioningManager
public NodePartitioningManager getNodePartitioningManager()
- Specified by:
getNodePartitioningManager
in interfaceQueryRunner
-
getPageSourceManager
public PageSourceManager getPageSourceManager()
- Specified by:
getPageSourceManager
in interfaceQueryRunner
-
getSplitManager
public SplitManager getSplitManager()
- Specified by:
getSplitManager
in interfaceQueryRunner
-
getStatsCalculator
public StatsCalculator getStatsCalculator()
- Specified by:
getStatsCalculator
in interfaceQueryRunner
-
getCostCalculator
public CostCalculator getCostCalculator()
-
getEstimatedExchangesCostCalculator
public CostCalculator getEstimatedExchangesCostCalculator()
-
getAccessControl
public TestingAccessControlManager getAccessControl()
- Specified by:
getAccessControl
in interfaceQueryRunner
-
getExecutor
public ExecutorService getExecutor()
-
getScheduler
public ScheduledExecutorService getScheduler()
-
getDefaultSession
public Session getDefaultSession()
- Specified by:
getDefaultSession
in 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:
installPlugin
in interfaceQueryRunner
-
addFunctions
public void addFunctions(List<? extends SqlFunction> functions)
- Specified by:
addFunctions
in interfaceQueryRunner
-
createCatalog
public void createCatalog(String catalogName, String connectorName, Map<String,String> properties)
- Specified by:
createCatalog
in interfaceQueryRunner
-
printPlan
public LocalQueryRunner printPlan()
-
listTables
public List<QualifiedObjectName> listTables(Session session, String catalog, String schema)
- Specified by:
listTables
in interfaceQueryRunner
-
tableExists
public boolean tableExists(Session session, String table)
- Specified by:
tableExists
in interfaceQueryRunner
-
execute
public MaterializedResult execute(String sql)
- Specified by:
execute
in interfaceQueryRunner
-
execute
public MaterializedResult execute(Session session, String sql)
- Specified by:
execute
in interfaceQueryRunner
-
executeWithPlan
public QueryRunner.MaterializedResultWithPlan executeWithPlan(Session session, String sql, WarningCollector warningCollector)
- Specified by:
executeWithPlan
in interfaceQueryRunner
-
inTransaction
public <T> T inTransaction(Session session, Function<Session,T> transactionSessionConsumer)
-
getExclusiveLock
public Lock getExclusiveLock()
- Specified by:
getExclusiveLock
in 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:
createPlan
in 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)
-
-