@VisibleForTesting public TypeRegistry() { this(ImmutableSet.of(), new FeaturesConfig()); }
public static MetadataManager createTestMetadataManager(CatalogManager catalogManager) { return createTestMetadataManager(catalogManager, new FeaturesConfig()); }
public TestingConnectorContext() { // associate typeManager with a function registry new FunctionRegistry(typeManager, new BlockEncodingManager(typeManager), new FeaturesConfig()); }
public static LocalQueryRunner queryRunnerWithInitialTransaction(Session defaultSession) { checkArgument(!defaultSession.getTransactionId().isPresent(), "Already in transaction!"); return new LocalQueryRunner(defaultSession, new FeaturesConfig(), new NodeSpillConfig(), true, false); }
@Test(groups = JDBC) public void testSessionProperties() throws SQLException { final String joinDistributionType = "join_distribution_type"; final String defaultValue = new FeaturesConfig().getJoinDistributionType().name(); assertThat(getSessionProperty(connection(), joinDistributionType)).isEqualTo(defaultValue); setSessionProperty(connection(), joinDistributionType, "BROADCAST"); assertThat(getSessionProperty(connection(), joinDistributionType)).isEqualTo("BROADCAST"); resetSessionProperty(connection(), joinDistributionType); assertThat(getSessionProperty(connection(), joinDistributionType)).isEqualTo(defaultValue); }
TestSignatureBinder() { // associate typeRegistry with a function registry new FunctionRegistry(typeRegistry, new BlockEncodingManager(typeRegistry), new FeaturesConfig()); }
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 final void initTestAggregationFunction() { typeRegistry = new TypeRegistry(); functionRegistry = new FunctionRegistry(typeRegistry, new BlockEncodingManager(typeRegistry), 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); }
private static QueryRunner createQueryRunner() { return new LocalQueryRunner(testSessionBuilder().build(), new FeaturesConfig().setGroupByUsesEqualTo(true)); } }
@BeforeClass public void setUp() { registerScalar(getClass()); legacyRowFieldOrdinalAccess = new FunctionAssertions( Session.builder(session) .setSystemProperty(LEGACY_ROW_FIELD_ORDINAL_ACCESS, "true") .build(), new FeaturesConfig()); }
public MetadataManager getMetadata(HistogramGroupImplementation groupMode) { MetadataManager metadata = MetadataManager.createTestMetadataManager(new FeaturesConfig() .setHistogramGroupImplementation(groupMode)); return metadata; } }
private static QueryRunner createQueryRunner(boolean legacyLogFunction) { return new LocalQueryRunner(testSessionBuilder().build(), new FeaturesConfig().setLegacyLogFunction(legacyLogFunction)); } }
@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()); }
@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()); }
@BeforeClass public void setUp() throws Exception { tempDirectory = createTempDirectory(getClass().getSimpleName()); FeaturesConfig featuresConfig = new FeaturesConfig(); featuresConfig.setSpillerSpillPaths(tempDirectory.toString()); featuresConfig.setSpillerThreads(8); featuresConfig.setSpillMaxUsedSpaceThreshold(1.0); singleStreamSpillerFactory = new FileSingleStreamSpillerFactory(blockEncodingSerde, new SpillerStats(), featuresConfig); factory = new GenericPartitioningSpillerFactory(singleStreamSpillerFactory); scheduledExecutor = newSingleThreadScheduledExecutor(); }
private Signature resolveSignature() { FunctionRegistry functionRegistry = new FunctionRegistry(typeRegistry, blockEncoding, new FeaturesConfig()); functionRegistry.addFunctions(createFunctionsFromSignatures()); return functionRegistry.resolveFunction(QualifiedName.of(TEST_FUNCTION_NAME), fromTypeSignatures(parameterTypes)); }
@Test public void testIdentityCast() { TypeRegistry typeManager = new TypeRegistry(); FunctionRegistry registry = new FunctionRegistry(typeManager, new BlockEncodingManager(typeManager), new FeaturesConfig()); Signature exactOperator = registry.getCoercion(HYPER_LOG_LOG, HYPER_LOG_LOG); assertEquals(exactOperator.getName(), mangleOperatorName(OperatorType.CAST.name())); assertEquals(transform(exactOperator.getArgumentTypes(), Functions.toStringFunction()), ImmutableList.of(StandardTypes.HYPER_LOG_LOG)); assertEquals(exactOperator.getReturnType().getBase(), StandardTypes.HYPER_LOG_LOG); }
@Test(expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = "'sum' is both an aggregation and a scalar function") public void testConflictingScalarAggregation() { List<SqlFunction> functions = new FunctionListBuilder() .scalars(ScalarSum.class) .getFunctions(); TypeRegistry typeManager = new TypeRegistry(); FunctionRegistry registry = new FunctionRegistry(typeManager, new BlockEncodingManager(typeManager), new FeaturesConfig()); registry.addFunctions(functions); }
@Test public void testMagicLiteralFunction() { Signature signature = getMagicLiteralFunctionSignature(TIMESTAMP_WITH_TIME_ZONE); assertEquals(signature.getName(), "$literal$timestamp with time zone"); assertEquals(signature.getArgumentTypes(), ImmutableList.of(parseTypeSignature(StandardTypes.BIGINT))); assertEquals(signature.getReturnType().getBase(), StandardTypes.TIMESTAMP_WITH_TIME_ZONE); TypeRegistry typeManager = new TypeRegistry(); FunctionRegistry registry = new FunctionRegistry(typeManager, new BlockEncodingManager(typeManager), new FeaturesConfig()); Signature function = registry.resolveFunction(QualifiedName.of(signature.getName()), fromTypeSignatures(signature.getArgumentTypes())); assertEquals(function.getArgumentTypes(), ImmutableList.of(parseTypeSignature(StandardTypes.BIGINT))); assertEquals(signature.getReturnType().getBase(), StandardTypes.TIMESTAMP_WITH_TIME_ZONE); }