use of io.prestosql.cost.ConnectorFilterStatsCalculatorService in project boostkit-bigdata by kunpengcompute.
the class TestHivePlanOptimizerProvider method testProvider.
@Test
public void testProvider() {
RowExpressionService expressionService = new ConnectorRowExpressionService(new RowExpressionDomainTranslator(OFFLOAD_METADATA), new RowExpressionDeterminismEvaluator(OFFLOAD_METADATA));
HiveTransactionManager transactionManager = simulationHiveTransactionManager();
StandardFunctionResolution resolution = new FunctionResolution(OFFLOAD_METADATA.getFunctionAndTypeManager());
HivePartitionManager partitionManager = new HivePartitionManager(OFFLOAD_METADATA.getFunctionAndTypeManager(), 1, false, 1);
ScalarStatsCalculator scalarStatsCalculator = new ScalarStatsCalculator(OFFLOAD_METADATA);
StatsNormalizer normalizer = new StatsNormalizer();
FilterStatsCalculator statsCalculator = new FilterStatsCalculator(OFFLOAD_METADATA, scalarStatsCalculator, normalizer);
FilterStatsCalculatorService calculatorService = new ConnectorFilterStatsCalculatorService(statsCalculator);
HiveMetadataFactory hiveMetadataFactory = Mockito.mock(HiveMetadataFactory.class);
HiveMetadata hiveMetadata = simulationHiveMetadata();
Mockito.when(hiveMetadataFactory.get()).thenReturn(hiveMetadata);
HivePlanOptimizerProvider hivePlanOptimizerProvider = new HivePlanOptimizerProvider(transactionManager, expressionService, resolution, partitionManager, OFFLOAD_METADATA.getFunctionAndTypeManager(), calculatorService, hiveMetadataFactory);
assertEquals(hivePlanOptimizerProvider.getLogicalPlanOptimizers().size(), 3);
assertEquals(hivePlanOptimizerProvider.getPhysicalPlanOptimizers().size(), 3);
}
use of io.prestosql.cost.ConnectorFilterStatsCalculatorService in project boostkit-bigdata by kunpengcompute.
the class TestHiveFilterPushdown method createOptimizer.
private static HiveFilterPushdown createOptimizer() {
RowExpressionService expressionService = new ConnectorRowExpressionService(new RowExpressionDomainTranslator(OFFLOAD_METADATA), new RowExpressionDeterminismEvaluator(OFFLOAD_METADATA));
HiveTransactionManager transactionManager = simulationHiveTransactionManager();
StandardFunctionResolution resolution = new FunctionResolution(OFFLOAD_METADATA.getFunctionAndTypeManager());
HivePartitionManager partitionManager = new HivePartitionManager(OFFLOAD_METADATA.getFunctionAndTypeManager(), 1, false, 1);
ScalarStatsCalculator scalarStatsCalculator = new ScalarStatsCalculator(OFFLOAD_METADATA);
StatsNormalizer normalizer = new StatsNormalizer();
FilterStatsCalculator statsCalculator = new FilterStatsCalculator(OFFLOAD_METADATA, scalarStatsCalculator, normalizer);
FilterStatsCalculatorService calculatorService = new ConnectorFilterStatsCalculatorService(statsCalculator);
HiveFilterPushdown optimizer = new HiveFilterPushdown(transactionManager, expressionService, resolution, partitionManager, calculatorService, OFFLOAD_METADATA.getFunctionAndTypeManager());
return optimizer;
}
use of io.prestosql.cost.ConnectorFilterStatsCalculatorService in project hetu-core by openlookeng.
the class ConnectorManager method createConnector.
public Connector createConnector(CatalogName catalogName, ConnectorFactory factory, Map<String, String> properties) {
ConnectorContext context = new ConnectorContextInstance(new ConnectorAwareNodeManager(nodeManager, nodeInfo.getEnvironment(), catalogName), versionEmbedder, new InternalTypeManager(metadataManager.getFunctionAndTypeManager()), pageSorter, pageIndexerFactory, hetuMetaStoreManager.getHetuMetastore(), heuristicIndexerManager.getIndexClient(), new ConnectorRowExpressionService(domainTranslator, determinismEvaluator), metadataManager.getFunctionAndTypeManager(), new FunctionResolution(metadataManager.getFunctionAndTypeManager()), metadataManager.getFunctionAndTypeManager().getBlockEncodingSerde(), new ConnectorFilterStatsCalculatorService(filterStatsCalculator));
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(factory.getClass().getClassLoader())) {
Connector connector = factory.create(catalogName.getCatalogName(), properties, context);
registerExternalFunctions(connector.getExternalFunctionHub(), metadataManager.getFunctionAndTypeManager());
return connector;
}
}
Aggregations