Search in sources :

Example 11 with VARCHAR

use of io.trino.spi.type.VarcharType.VARCHAR in project trino by trinodb.

the class TestPolymorphicScalarFunction method testSetsHiddenToTrueForOperators.

@Test
public void testSetsHiddenToTrueForOperators() {
    Signature signature = Signature.builder().operatorType(ADD).returnType(new TypeSignature("varchar", typeVariable("x"))).argumentTypes(new TypeSignature("varchar", typeVariable("x"))).build();
    SqlScalarFunction function = new PolymorphicScalarFunctionBuilder(TestMethods.class).signature(signature).deterministic(true).choice(choice -> choice.implementation(methodsGroup -> methodsGroup.methods("varcharToVarchar"))).build();
    BoundSignature boundSignature = new BoundSignature(signature.getName(), createVarcharType(INPUT_VARCHAR_LENGTH), ImmutableList.of(createVarcharType(INPUT_VARCHAR_LENGTH)));
    function.specialize(boundSignature, new FunctionDependencies(FUNCTION_MANAGER::getScalarFunctionInvoker, ImmutableMap.of(), ImmutableSet.of()));
}
Also used : VARCHAR_TO_VARCHAR_RETURN_VALUE(io.trino.metadata.TestPolymorphicScalarFunction.TestMethods.VARCHAR_TO_VARCHAR_RETURN_VALUE) BLOCK_POSITION(io.trino.spi.function.InvocationConvention.InvocationArgumentConvention.BLOCK_POSITION) Slice(io.airlift.slice.Slice) FAIL_ON_NULL(io.trino.spi.function.InvocationConvention.InvocationReturnConvention.FAIL_ON_NULL) MAX_SHORT_PRECISION(io.trino.spi.type.Decimals.MAX_SHORT_PRECISION) TypeSignatureParameter.typeVariable(io.trino.spi.type.TypeSignatureParameter.typeVariable) BOOLEAN(io.trino.spi.type.BooleanType.BOOLEAN) Assert.assertEquals(org.testng.Assert.assertEquals) ChoicesScalarFunctionImplementation(io.trino.operator.scalar.ChoicesScalarFunctionImplementation) Test(org.testng.annotations.Test) IS_DISTINCT_FROM(io.trino.spi.function.OperatorType.IS_DISTINCT_FROM) FunctionManager.createTestingFunctionManager(io.trino.metadata.FunctionManager.createTestingFunctionManager) VARCHAR(io.trino.spi.type.VarcharType.VARCHAR) ImmutableList(com.google.common.collect.ImmutableList) NULL_FLAG(io.trino.spi.function.InvocationConvention.InvocationArgumentConvention.NULL_FLAG) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) Block(io.trino.spi.block.Block) Arrays.asList(java.util.Arrays.asList) Slices(io.airlift.slice.Slices) LongArrayBlock(io.trino.spi.block.LongArrayBlock) Assert.assertFalse(org.testng.Assert.assertFalse) TypeSignature(io.trino.spi.type.TypeSignature) Int128(io.trino.spi.type.Int128) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) Signature.comparableWithVariadicBound(io.trino.metadata.Signature.comparableWithVariadicBound) VARCHAR_TO_BIGINT_RETURN_VALUE(io.trino.metadata.TestPolymorphicScalarFunction.TestMethods.VARCHAR_TO_BIGINT_RETURN_VALUE) InvocationConvention(io.trino.spi.function.InvocationConvention) ADD(io.trino.spi.function.OperatorType.ADD) BIGINT(io.trino.spi.type.BigintType.BIGINT) Optional(java.util.Optional) Assert.assertTrue(org.testng.Assert.assertTrue) VarcharType.createVarcharType(io.trino.spi.type.VarcharType.createVarcharType) DecimalType(io.trino.spi.type.DecimalType) TypeSignature(io.trino.spi.type.TypeSignature) TypeSignature(io.trino.spi.type.TypeSignature) Test(org.testng.annotations.Test)

Example 12 with VARCHAR

use of io.trino.spi.type.VarcharType.VARCHAR in project trino by trinodb.

the class TestPolymorphicScalarFunction method testSameLiteralInArgumentsAndReturnValue.

@Test
public void testSameLiteralInArgumentsAndReturnValue() throws Throwable {
    Signature signature = Signature.builder().name("foo").returnType(new TypeSignature("varchar", typeVariable("x"))).argumentTypes(new TypeSignature("varchar", typeVariable("x"))).build();
    SqlScalarFunction function = new PolymorphicScalarFunctionBuilder(TestMethods.class).signature(signature).deterministic(true).choice(choice -> choice.implementation(methodsGroup -> methodsGroup.methods("varcharToVarchar"))).build();
    BoundSignature boundSignature = new BoundSignature(signature.getName(), createVarcharType(INPUT_VARCHAR_LENGTH), ImmutableList.of(createVarcharType(INPUT_VARCHAR_LENGTH)));
    ChoicesScalarFunctionImplementation functionImplementation = (ChoicesScalarFunctionImplementation) function.specialize(boundSignature, new FunctionDependencies(FUNCTION_MANAGER::getScalarFunctionInvoker, ImmutableMap.of(), ImmutableSet.of()));
    Slice slice = (Slice) functionImplementation.getChoices().get(0).getMethodHandle().invoke(INPUT_SLICE);
    assertEquals(slice, VARCHAR_TO_VARCHAR_RETURN_VALUE);
}
Also used : VARCHAR_TO_VARCHAR_RETURN_VALUE(io.trino.metadata.TestPolymorphicScalarFunction.TestMethods.VARCHAR_TO_VARCHAR_RETURN_VALUE) BLOCK_POSITION(io.trino.spi.function.InvocationConvention.InvocationArgumentConvention.BLOCK_POSITION) Slice(io.airlift.slice.Slice) FAIL_ON_NULL(io.trino.spi.function.InvocationConvention.InvocationReturnConvention.FAIL_ON_NULL) MAX_SHORT_PRECISION(io.trino.spi.type.Decimals.MAX_SHORT_PRECISION) TypeSignatureParameter.typeVariable(io.trino.spi.type.TypeSignatureParameter.typeVariable) BOOLEAN(io.trino.spi.type.BooleanType.BOOLEAN) Assert.assertEquals(org.testng.Assert.assertEquals) ChoicesScalarFunctionImplementation(io.trino.operator.scalar.ChoicesScalarFunctionImplementation) Test(org.testng.annotations.Test) IS_DISTINCT_FROM(io.trino.spi.function.OperatorType.IS_DISTINCT_FROM) FunctionManager.createTestingFunctionManager(io.trino.metadata.FunctionManager.createTestingFunctionManager) VARCHAR(io.trino.spi.type.VarcharType.VARCHAR) ImmutableList(com.google.common.collect.ImmutableList) NULL_FLAG(io.trino.spi.function.InvocationConvention.InvocationArgumentConvention.NULL_FLAG) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) Block(io.trino.spi.block.Block) Arrays.asList(java.util.Arrays.asList) Slices(io.airlift.slice.Slices) LongArrayBlock(io.trino.spi.block.LongArrayBlock) Assert.assertFalse(org.testng.Assert.assertFalse) TypeSignature(io.trino.spi.type.TypeSignature) Int128(io.trino.spi.type.Int128) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) Signature.comparableWithVariadicBound(io.trino.metadata.Signature.comparableWithVariadicBound) VARCHAR_TO_BIGINT_RETURN_VALUE(io.trino.metadata.TestPolymorphicScalarFunction.TestMethods.VARCHAR_TO_BIGINT_RETURN_VALUE) InvocationConvention(io.trino.spi.function.InvocationConvention) ADD(io.trino.spi.function.OperatorType.ADD) BIGINT(io.trino.spi.type.BigintType.BIGINT) Optional(java.util.Optional) Assert.assertTrue(org.testng.Assert.assertTrue) VarcharType.createVarcharType(io.trino.spi.type.VarcharType.createVarcharType) DecimalType(io.trino.spi.type.DecimalType) TypeSignature(io.trino.spi.type.TypeSignature) Slice(io.airlift.slice.Slice) TypeSignature(io.trino.spi.type.TypeSignature) ChoicesScalarFunctionImplementation(io.trino.operator.scalar.ChoicesScalarFunctionImplementation) Test(org.testng.annotations.Test)

Example 13 with VARCHAR

use of io.trino.spi.type.VarcharType.VARCHAR in project trino by trinodb.

the class TestPolymorphicScalarFunction method testTypeParameters.

@Test
public void testTypeParameters() throws Throwable {
    Signature signature = Signature.builder().name("foo").typeVariableConstraints(comparableWithVariadicBound("V", "ROW")).returnType(new TypeSignature("V")).argumentTypes(new TypeSignature("V")).build();
    SqlScalarFunction function = new PolymorphicScalarFunctionBuilder(TestMethods.class).signature(signature).deterministic(true).choice(choice -> choice.implementation(methodsGroup -> methodsGroup.methods("varcharToVarchar"))).build();
    BoundSignature boundSignature = new BoundSignature(signature.getName(), VARCHAR, ImmutableList.of(VARCHAR));
    ChoicesScalarFunctionImplementation functionImplementation = (ChoicesScalarFunctionImplementation) function.specialize(boundSignature, new FunctionDependencies(FUNCTION_MANAGER::getScalarFunctionInvoker, ImmutableMap.of(), ImmutableSet.of()));
    Slice slice = (Slice) functionImplementation.getChoices().get(0).getMethodHandle().invoke(INPUT_SLICE);
    assertEquals(slice, VARCHAR_TO_VARCHAR_RETURN_VALUE);
}
Also used : VARCHAR_TO_VARCHAR_RETURN_VALUE(io.trino.metadata.TestPolymorphicScalarFunction.TestMethods.VARCHAR_TO_VARCHAR_RETURN_VALUE) BLOCK_POSITION(io.trino.spi.function.InvocationConvention.InvocationArgumentConvention.BLOCK_POSITION) Slice(io.airlift.slice.Slice) FAIL_ON_NULL(io.trino.spi.function.InvocationConvention.InvocationReturnConvention.FAIL_ON_NULL) MAX_SHORT_PRECISION(io.trino.spi.type.Decimals.MAX_SHORT_PRECISION) TypeSignatureParameter.typeVariable(io.trino.spi.type.TypeSignatureParameter.typeVariable) BOOLEAN(io.trino.spi.type.BooleanType.BOOLEAN) Assert.assertEquals(org.testng.Assert.assertEquals) ChoicesScalarFunctionImplementation(io.trino.operator.scalar.ChoicesScalarFunctionImplementation) Test(org.testng.annotations.Test) IS_DISTINCT_FROM(io.trino.spi.function.OperatorType.IS_DISTINCT_FROM) FunctionManager.createTestingFunctionManager(io.trino.metadata.FunctionManager.createTestingFunctionManager) VARCHAR(io.trino.spi.type.VarcharType.VARCHAR) ImmutableList(com.google.common.collect.ImmutableList) NULL_FLAG(io.trino.spi.function.InvocationConvention.InvocationArgumentConvention.NULL_FLAG) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) Block(io.trino.spi.block.Block) Arrays.asList(java.util.Arrays.asList) Slices(io.airlift.slice.Slices) LongArrayBlock(io.trino.spi.block.LongArrayBlock) Assert.assertFalse(org.testng.Assert.assertFalse) TypeSignature(io.trino.spi.type.TypeSignature) Int128(io.trino.spi.type.Int128) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) Signature.comparableWithVariadicBound(io.trino.metadata.Signature.comparableWithVariadicBound) VARCHAR_TO_BIGINT_RETURN_VALUE(io.trino.metadata.TestPolymorphicScalarFunction.TestMethods.VARCHAR_TO_BIGINT_RETURN_VALUE) InvocationConvention(io.trino.spi.function.InvocationConvention) ADD(io.trino.spi.function.OperatorType.ADD) BIGINT(io.trino.spi.type.BigintType.BIGINT) Optional(java.util.Optional) Assert.assertTrue(org.testng.Assert.assertTrue) VarcharType.createVarcharType(io.trino.spi.type.VarcharType.createVarcharType) DecimalType(io.trino.spi.type.DecimalType) TypeSignature(io.trino.spi.type.TypeSignature) Slice(io.airlift.slice.Slice) TypeSignature(io.trino.spi.type.TypeSignature) ChoicesScalarFunctionImplementation(io.trino.operator.scalar.ChoicesScalarFunctionImplementation) Test(org.testng.annotations.Test)

Example 14 with VARCHAR

use of io.trino.spi.type.VarcharType.VARCHAR in project trino by trinodb.

the class TestDefaultJdbcMetadata method testAggregationPushdownForTableHandle.

@Test
public void testAggregationPushdownForTableHandle() {
    ConnectorSession session = TestingConnectorSession.builder().setPropertyMetadata(new JdbcMetadataSessionProperties(new JdbcMetadataConfig().setAggregationPushdownEnabled(true), Optional.empty()).getSessionProperties()).build();
    ColumnHandle groupByColumn = metadata.getColumnHandles(session, tableHandle).get("text");
    Function<ConnectorTableHandle, Optional<AggregationApplicationResult<ConnectorTableHandle>>> applyAggregation = handle -> metadata.applyAggregation(session, handle, ImmutableList.of(new AggregateFunction("count", BIGINT, List.of(), List.of(), false, Optional.empty())), ImmutableMap.of(), ImmutableList.of(ImmutableList.of(groupByColumn)));
    ConnectorTableHandle baseTableHandle = metadata.getTableHandle(session, new SchemaTableName("example", "numbers"));
    Optional<AggregationApplicationResult<ConnectorTableHandle>> aggregationResult = applyAggregation.apply(baseTableHandle);
    assertThat(aggregationResult).isPresent();
    SchemaTableName noAggregationPushdownTable = new SchemaTableName("example", "no_aggregation_pushdown");
    metadata.createTable(SESSION, new ConnectorTableMetadata(noAggregationPushdownTable, ImmutableList.of(new ColumnMetadata("text", VARCHAR))), false);
    ConnectorTableHandle noAggregationPushdownTableHandle = metadata.getTableHandle(session, noAggregationPushdownTable);
    aggregationResult = applyAggregation.apply(noAggregationPushdownTableHandle);
    assertThat(aggregationResult).isEmpty();
}
Also used : Constraint(io.trino.spi.connector.Constraint) Assert.assertNull(org.testng.Assert.assertNull) ColumnMetadata(io.trino.spi.connector.ColumnMetadata) AggregateFunction(io.trino.spi.connector.AggregateFunction) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Assert.assertEquals(org.testng.Assert.assertEquals) ConnectorTableMetadata(io.trino.spi.connector.ConnectorTableMetadata) Test(org.testng.annotations.Test) AfterMethod(org.testng.annotations.AfterMethod) TrinoExceptionAssert.assertTrinoExceptionThrownBy(io.trino.testing.assertions.TrinoExceptionAssert.assertTrinoExceptionThrownBy) Function(java.util.function.Function) VARCHAR(io.trino.spi.type.VarcharType.VARCHAR) TableNotFoundException(io.trino.spi.connector.TableNotFoundException) ImmutableList(com.google.common.collect.ImmutableList) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) ConnectorTableHandle(io.trino.spi.connector.ConnectorTableHandle) Map(java.util.Map) ColumnHandle(io.trino.spi.connector.ColumnHandle) Slices.utf8Slice(io.airlift.slice.Slices.utf8Slice) NOT_FOUND(io.trino.spi.StandardErrorCode.NOT_FOUND) JDBC_VARCHAR(io.trino.plugin.jdbc.TestingJdbcTypeHandle.JDBC_VARCHAR) Collections.emptyMap(java.util.Collections.emptyMap) ImmutableSet(com.google.common.collect.ImmutableSet) ConstraintApplicationResult(io.trino.spi.connector.ConstraintApplicationResult) ImmutableMap(com.google.common.collect.ImmutableMap) Domain(io.trino.spi.predicate.Domain) BeforeMethod(org.testng.annotations.BeforeMethod) JDBC_BIGINT(io.trino.plugin.jdbc.TestingJdbcTypeHandle.JDBC_BIGINT) SESSION(io.trino.testing.TestingConnectorSession.SESSION) ConnectorSession(io.trino.spi.connector.ConnectorSession) TupleDomain(io.trino.spi.predicate.TupleDomain) SchemaTableName(io.trino.spi.connector.SchemaTableName) AggregationApplicationResult(io.trino.spi.connector.AggregationApplicationResult) TestingConnectorSession(io.trino.testing.TestingConnectorSession) List(java.util.List) BIGINT(io.trino.spi.type.BigintType.BIGINT) Optional(java.util.Optional) Assert.assertTrue(org.testng.Assert.assertTrue) VarcharType.createVarcharType(io.trino.spi.type.VarcharType.createVarcharType) ColumnHandle(io.trino.spi.connector.ColumnHandle) ColumnMetadata(io.trino.spi.connector.ColumnMetadata) Optional(java.util.Optional) SchemaTableName(io.trino.spi.connector.SchemaTableName) ConnectorTableHandle(io.trino.spi.connector.ConnectorTableHandle) AggregateFunction(io.trino.spi.connector.AggregateFunction) ConnectorSession(io.trino.spi.connector.ConnectorSession) TestingConnectorSession(io.trino.testing.TestingConnectorSession) AggregationApplicationResult(io.trino.spi.connector.AggregationApplicationResult) ConnectorTableMetadata(io.trino.spi.connector.ConnectorTableMetadata) Test(org.testng.annotations.Test)

Example 15 with VARCHAR

use of io.trino.spi.type.VarcharType.VARCHAR in project trino by trinodb.

the class TestHashJoinOperator method testOuterJoinWithNullProbeAndFilterFunction.

@Test(dataProvider = "hashJoinTestValues")
public void testOuterJoinWithNullProbeAndFilterFunction(boolean parallelBuild, boolean probeHashEnabled, boolean buildHashEnabled) {
    TaskContext taskContext = createTaskContext();
    InternalJoinFilterFunction filterFunction = new TestInternalJoinFilterFunction(((leftPosition, leftPage, rightPosition, rightPage) -> VARCHAR.getSlice(rightPage.getBlock(0), rightPosition).toStringAscii().equals("a")));
    // build factory
    List<Type> buildTypes = ImmutableList.of(VARCHAR);
    RowPagesBuilder buildPages = rowPagesBuilder(buildHashEnabled, Ints.asList(0), buildTypes).row("a").row("b").row("c");
    BuildSideSetup buildSideSetup = setupBuildSide(nodePartitioningManager, parallelBuild, taskContext, buildPages, Optional.of(filterFunction), false, SINGLE_STREAM_SPILLER_FACTORY);
    JoinBridgeManager<PartitionedLookupSourceFactory> lookupSourceFactory = buildSideSetup.getLookupSourceFactoryManager();
    // probe factory
    List<Type> probeTypes = ImmutableList.of(VARCHAR);
    RowPagesBuilder probePages = rowPagesBuilder(probeHashEnabled, Ints.asList(0), probeTypes);
    List<Page> probeInput = probePages.row("a").row((String) null).row((String) null).row("a").row("b").build();
    OperatorFactory joinOperatorFactory = probeOuterJoinOperatorFactory(lookupSourceFactory, probePages, true);
    // build drivers and operators
    instantiateBuildDrivers(buildSideSetup, taskContext);
    buildLookupSource(executor, buildSideSetup);
    // expected
    MaterializedResult expected = MaterializedResult.resultBuilder(taskContext.getSession(), concat(probeTypes, buildTypes)).row("a", "a").row(null, null).row(null, null).row("a", "a").row("b", null).build();
    assertOperatorEquals(joinOperatorFactory, taskContext.addPipelineContext(0, true, true, false).addDriverContext(), probeInput, expected, true, getHashChannels(probePages, buildPages));
}
Also used : OperatorAssertion.assertOperatorEquals(io.trino.operator.OperatorAssertion.assertOperatorEquals) Arrays(java.util.Arrays) Test(org.testng.annotations.Test) TypeOperators(io.trino.spi.type.TypeOperators) TaskStateMachine(io.trino.execution.TaskStateMachine) AfterMethod(org.testng.annotations.AfterMethod) OperatorContext(io.trino.operator.OperatorContext) Collections.singletonList(java.util.Collections.singletonList) NodeScheduler(io.trino.execution.scheduler.NodeScheduler) FinalizerService(io.trino.util.FinalizerService) ExceededMemoryLimitException(io.trino.ExceededMemoryLimitException) PlanNodeId(io.trino.sql.planner.plan.PlanNodeId) Executors.newScheduledThreadPool(java.util.concurrent.Executors.newScheduledThreadPool) BuildSideSetup(io.trino.operator.join.JoinTestUtils.BuildSideSetup) Arrays.asList(java.util.Arrays.asList) Slices(io.airlift.slice.Slices) WorkProcessor(io.trino.operator.WorkProcessor) TEST_SESSION(io.trino.SessionTestUtils.TEST_SESSION) ProcessState.finished(io.trino.operator.WorkProcessor.ProcessState.finished) Assert.assertFalse(org.testng.Assert.assertFalse) Assert.assertEquals(io.trino.testing.assertions.Assert.assertEquals) TestInternalJoinFilterFunction(io.trino.operator.join.JoinTestUtils.TestInternalJoinFilterFunction) NodeSchedulerConfig(io.trino.execution.scheduler.NodeSchedulerConfig) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) TrinoOperatorFactories(io.trino.operator.TrinoOperatorFactories) WorkProcessorOperatorFactory(io.trino.operator.WorkProcessorOperatorFactory) ProcessState.ofResult(io.trino.operator.WorkProcessor.ProcessState.ofResult) RowPagesBuilder(io.trino.RowPagesBuilder) OperatorAssertion.without(io.trino.operator.OperatorAssertion.without) InMemoryNodeManager(io.trino.metadata.InMemoryNodeManager) ValuesOperatorFactory(io.trino.operator.ValuesOperator.ValuesOperatorFactory) Iterables(com.google.common.collect.Iterables) StageId(io.trino.execution.StageId) Page(io.trino.spi.Page) NodePartitioningManager(io.trino.sql.planner.NodePartitioningManager) JoinTestUtils.getHashChannelAsInt(io.trino.operator.join.JoinTestUtils.getHashChannelAsInt) ArrayList(java.util.ArrayList) VARCHAR(io.trino.spi.type.VarcharType.VARCHAR) WorkProcessorOperator(io.trino.operator.WorkProcessorOperator) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) Lifespan(io.trino.execution.Lifespan) BlockTypeOperators(io.trino.type.BlockTypeOperators) Iterables.getOnlyElement(com.google.common.collect.Iterables.getOnlyElement) MoreFutures.getFutureValue(io.airlift.concurrent.MoreFutures.getFutureValue) JoinTestUtils.instantiateBuildDrivers(io.trino.operator.join.JoinTestUtils.instantiateBuildDrivers) Driver(io.trino.operator.Driver) NodeTaskMap(io.trino.execution.NodeTaskMap) MaterializedResult(io.trino.testing.MaterializedResult) PageBufferOperatorFactory(io.trino.operator.index.PageBufferOperator.PageBufferOperatorFactory) JoinTestUtils.innerJoinOperatorFactory(io.trino.operator.join.JoinTestUtils.innerJoinOperatorFactory) LazyBlock(io.trino.spi.block.LazyBlock) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) RowPagesBuilder.rowPagesBuilder(io.trino.RowPagesBuilder.rowPagesBuilder) INTEGER(io.trino.spi.type.IntegerType.INTEGER) OperatorAssertion.dropChannel(io.trino.operator.OperatorAssertion.dropChannel) RunLengthEncodedBlock(io.trino.spi.block.RunLengthEncodedBlock) ImmutableSet(com.google.common.collect.ImmutableSet) Operator(io.trino.operator.Operator) SynchronousQueue(java.util.concurrent.SynchronousQueue) Collections.nCopies(java.util.Collections.nCopies) BeforeMethod(org.testng.annotations.BeforeMethod) Assert.assertNotNull(org.testng.Assert.assertNotNull) TaskId(io.trino.execution.TaskId) UniformNodeSelectorFactory(io.trino.execution.scheduler.UniformNodeSelectorFactory) String.format(java.lang.String.format) Preconditions.checkState(com.google.common.base.Preconditions.checkState) DataSize(io.airlift.units.DataSize) List(java.util.List) DriverContext(io.trino.operator.DriverContext) BIGINT(io.trino.spi.type.BigintType.BIGINT) Optional(java.util.Optional) JoinTestUtils.setupBuildSide(io.trino.operator.join.JoinTestUtils.setupBuildSide) OperatorFactories(io.trino.operator.OperatorFactories) PageBuffer(io.trino.operator.index.PageBuffer) ProcessorContext(io.trino.operator.ProcessorContext) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) DataProvider(org.testng.annotations.DataProvider) Assert.assertNull(org.testng.Assert.assertNull) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) Type(io.trino.spi.type.Type) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) JoinTestUtils.runDriverInThread(io.trino.operator.join.JoinTestUtils.runDriverInThread) OptionalInt(java.util.OptionalInt) TestingTaskContext(io.trino.testing.TestingTaskContext) ImmutableList(com.google.common.collect.ImmutableList) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) Threads.daemonThreadsNamed(io.airlift.concurrent.Threads.daemonThreadsNamed) Objects.requireNonNull(java.util.Objects.requireNonNull) TaskContext(io.trino.operator.TaskContext) GenericPartitioningSpillerFactory(io.trino.spiller.GenericPartitioningSpillerFactory) ExecutorService(java.util.concurrent.ExecutorService) OperatorFactory(io.trino.operator.OperatorFactory) OperatorAssertion(io.trino.operator.OperatorAssertion) SingleStreamSpillerFactory(io.trino.spiller.SingleStreamSpillerFactory) Ints(com.google.common.primitives.Ints) TimeUnit(java.util.concurrent.TimeUnit) PartitioningSpillerFactory(io.trino.spiller.PartitioningSpillerFactory) Assertions.assertEqualsIgnoreOrder(io.airlift.testing.Assertions.assertEqualsIgnoreOrder) Collectors.toList(java.util.stream.Collectors.toList) DummySpillerFactory(io.trino.operator.join.JoinTestUtils.DummySpillerFactory) JoinTestUtils.buildLookupSource(io.trino.operator.join.JoinTestUtils.buildLookupSource) Assert.assertTrue(org.testng.Assert.assertTrue) SECONDS(java.util.concurrent.TimeUnit.SECONDS) TestingTaskContext(io.trino.testing.TestingTaskContext) TaskContext(io.trino.operator.TaskContext) TestInternalJoinFilterFunction(io.trino.operator.join.JoinTestUtils.TestInternalJoinFilterFunction) RowPagesBuilder(io.trino.RowPagesBuilder) Page(io.trino.spi.Page) TestInternalJoinFilterFunction(io.trino.operator.join.JoinTestUtils.TestInternalJoinFilterFunction) Type(io.trino.spi.type.Type) BuildSideSetup(io.trino.operator.join.JoinTestUtils.BuildSideSetup) WorkProcessorOperatorFactory(io.trino.operator.WorkProcessorOperatorFactory) ValuesOperatorFactory(io.trino.operator.ValuesOperator.ValuesOperatorFactory) PageBufferOperatorFactory(io.trino.operator.index.PageBufferOperator.PageBufferOperatorFactory) JoinTestUtils.innerJoinOperatorFactory(io.trino.operator.join.JoinTestUtils.innerJoinOperatorFactory) OperatorFactory(io.trino.operator.OperatorFactory) MaterializedResult(io.trino.testing.MaterializedResult) Test(org.testng.annotations.Test)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)37 VARCHAR (io.trino.spi.type.VarcharType.VARCHAR)37 Test (org.testng.annotations.Test)34 Optional (java.util.Optional)31 BIGINT (io.trino.spi.type.BigintType.BIGINT)30 ImmutableMap (com.google.common.collect.ImmutableMap)26 List (java.util.List)25 ColumnHandle (io.trino.spi.connector.ColumnHandle)20 Assertions.assertThatThrownBy (org.assertj.core.api.Assertions.assertThatThrownBy)20 Map (java.util.Map)19 TupleDomain (io.trino.spi.predicate.TupleDomain)18 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)17 Session (io.trino.Session)17 SchemaTableName (io.trino.spi.connector.SchemaTableName)16 ImmutableSet (com.google.common.collect.ImmutableSet)15 TableHandle (io.trino.metadata.TableHandle)15 Type (io.trino.spi.type.Type)15 TestingSession.testSessionBuilder (io.trino.testing.TestingSession.testSessionBuilder)15 Assert.assertTrue (org.testng.Assert.assertTrue)15 CatalogName (io.trino.connector.CatalogName)14