public static MetadataManager createTestMetadataManager(FeaturesConfig featuresConfig) { return createTestMetadataManager(new CatalogManager(), featuresConfig); }
public static MetadataManager createTestMetadataManager(CatalogManager catalogManager) { return createTestMetadataManager(catalogManager, new FeaturesConfig()); }
public static MetadataManager createTestMetadataManager(CatalogManager catalogManager, FeaturesConfig featuresConfig) { return createTestMetadataManager(createTestTransactionManager(catalogManager), featuresConfig); }
@Override public PagesIndex newPagesIndex(List<Type> types, int expectedPositions) { return new PagesIndex(ORDERING_COMPILER, JOIN_COMPILER, MetadataManager.createTestMetadataManager().getFunctionRegistry(), groupByUsesEqualTo, types, expectedPositions, eagerCompact); } }
@Override protected List<? extends OperatorFactory> createOperatorFactories() { OperatorFactory tableScanOperator = createTableScanOperator(0, new PlanNodeId("test"), "orders", "totalprice"); InternalAggregationFunction doubleSum = MetadataManager.createTestMetadataManager().getFunctionRegistry().getAggregateFunctionImplementation( new Signature("sum", AGGREGATE, DOUBLE.getTypeSignature(), DOUBLE.getTypeSignature())); AggregationOperatorFactory aggregationOperator = new AggregationOperatorFactory(1, new PlanNodeId("test"), Step.SINGLE, ImmutableList.of(doubleSum.bind(ImmutableList.of(0), Optional.empty())), false); return ImmutableList.of(tableScanOperator, aggregationOperator); }
public MetadataManager getMetadata(HistogramGroupImplementation groupMode) { MetadataManager metadata = MetadataManager.createTestMetadataManager(new FeaturesConfig() .setHistogramGroupImplementation(groupMode)); return metadata; } }
private static MetadataManager getMetadata(HistogramGroupImplementation groupMode) { MetadataManager metadata = MetadataManager.createTestMetadataManager( new FeaturesConfig() .setHistogramGroupImplementation(groupMode)); return metadata; }
@Test public void testGeneratedClassName() { PageFunctionCompiler functionCompiler = new PageFunctionCompiler(createTestMetadataManager(), 0); String planNodeId = "7"; String stageId = "20170707_223500_67496_zguwn.2"; String classSuffix = stageId + "_" + planNodeId; Supplier<PageProjection> projectionSupplier = functionCompiler.compileProjection(ADD_10_EXPRESSION, Optional.of(classSuffix)); PageProjection projection = projectionSupplier.get(); Work<Block> work = projection.project(SESSION, new DriverYieldSignal(), createLongBlockPage(0), SelectedPositions.positionsRange(0, 1)); // class name should look like PageProjectionOutput_20170707_223500_67496_zguwn_2_7_XX assertTrue(work.getClass().getSimpleName().startsWith("PageProjectionWork_" + stageId.replace('.', '_') + "_" + planNodeId)); }
private static PagesHashStrategy pagesHashStrategy() { return new SimplePagesHashStrategy( ImmutableList.of(BIGINT), ImmutableList.of(), ImmutableList.of(ImmutableList.of(TEST_PAGE.getBlock(0))), ImmutableList.of(), OptionalInt.empty(), Optional.of(0), MetadataManager.createTestMetadataManager().getFunctionRegistry(), new FeaturesConfig().isGroupByUsesEqualTo()); }
@BeforeClass public void setup() { metadataManager = createTestMetadataManager(); compiler = new ExpressionCompiler(metadataManager, new PageFunctionCompiler(metadataManager, 0)); }
@BeforeClass public void setUp() { calculator = new ScalarStatsCalculator(MetadataManager.createTestMetadataManager()); session = testSessionBuilder().build(); }
@BeforeClass public void setup() { metadata = createTestMetadataManager(); literalEncoder = new LiteralEncoder(metadata.getBlockEncodingSerde()); domainTranslator = new DomainTranslator(literalEncoder); }
@Setup public void setup() { MetadataManager metadata = MetadataManager.createTestMetadataManager(); ExpressionCompiler expressionCompiler = new ExpressionCompiler( metadata, new PageFunctionCompiler(metadata, 0)); RowExpression projection = generateComplexComparisonProjection(FIELDS_COUNT, COMPARISONS_COUNT); compiledProcessor = expressionCompiler.compilePageProcessor(Optional.empty(), ImmutableList.of(projection)).get(); }
@Setup public void setup() { inputPage = createInputPage(); MetadataManager metadata = MetadataManager.createTestMetadataManager(); compiledProcessor = new ExpressionCompiler(metadata, new PageFunctionCompiler(metadata, 0)).compilePageProcessor(Optional.of(FILTER), ImmutableList.of(PROJECT)).get(); }
private OperatorFactory createStreamingAggregationOperatorFactory() { return new StreamingAggregationOperatorFactory( 0, new PlanNodeId("test"), ImmutableList.of(VARCHAR), ImmutableList.of(VARCHAR), ImmutableList.of(0), AggregationNode.Step.SINGLE, ImmutableList.of(COUNT.bind(ImmutableList.of(0), Optional.empty()), LONG_SUM.bind(ImmutableList.of(1), Optional.empty())), new JoinCompiler(MetadataManager.createTestMetadataManager(), new FeaturesConfig())); }
@BeforeClass public void setUp() { MetadataManager metadata = MetadataManager.createTestMetadataManager(); avgFunction = metadata.getFunctionRegistry().getAggregateFunctionImplementation( new Signature("avg", FunctionKind.AGGREGATE, parseTypeSignature(StandardTypes.REAL), parseTypeSignature(StandardTypes.REAL))); }
@BeforeMethod public void setUp() { executor = newCachedThreadPool(daemonThreadsNamed("test-executor-%s")); scheduledExecutor = newScheduledThreadPool(2, daemonThreadsNamed("test-scheduledExecutor-%s")); driverContext = createTaskContext(executor, scheduledExecutor, TEST_SESSION) .addPipelineContext(0, true, true, false) .addDriverContext(); joinCompiler = new JoinCompiler(MetadataManager.createTestMetadataManager(), new FeaturesConfig()); }
private static GroupByHash createGroupByHash(List<Type> partitionTypes, List<Integer> partitionChannels, UpdateMemory updateMemory) { return GroupByHash.createGroupByHash( partitionTypes, Ints.toArray(partitionChannels), Optional.empty(), 1, false, new JoinCompiler(createTestMetadataManager(), new FeaturesConfig()), updateMemory); }
@BeforeMethod public void setUp() { executor = newCachedThreadPool(daemonThreadsNamed("test-executor-%s")); scheduledExecutor = newScheduledThreadPool(2, daemonThreadsNamed("test-scheduledExecutor-%s")); driverContext = createTaskContext(executor, scheduledExecutor, TEST_SESSION) .addPipelineContext(0, true, true, false) .addDriverContext(); joinCompiler = new JoinCompiler(MetadataManager.createTestMetadataManager(), new FeaturesConfig()); }
@Test public void testVarbinaryConstant() { MetadataManager metadata = createTestMetadataManager(); LiteralEncoder literalEncoder = new LiteralEncoder(metadata.getBlockEncodingSerde()); Expression expression = literalEncoder.toExpression(Slices.utf8Slice("ala ma kota"), VARBINARY); assertCalculate(expression) .distinctValuesCount(1.0) .lowValueUnknown() .highValueUnknown() .nullsFraction(0.0); }