use of io.confluent.ksql.execution.plan.PlanInfo in project ksql by confluentinc.
the class SourceBuilderV1Test method shouldApplyCorrectTransformationsToSourceTableWithDownstreamRepartition.
@Test
@SuppressWarnings("unchecked")
public void shouldApplyCorrectTransformationsToSourceTableWithDownstreamRepartition() {
// Given:
givenUnwindowedSourceTableV1(true, LEGACY_PSEUDOCOLUMN_VERSION_NUMBER);
final PlanInfo planInfo = givenDownstreamRepartition(tableSourceV1);
// When:
final KTableHolder<GenericKey> builtKTable = tableSourceV1.build(planBuilder, planInfo);
// Then:
assertThat(builtKTable.getTable(), is(kTable));
final InOrder validator = inOrder(streamsBuilder, kTable);
validator.verify(streamsBuilder).table(eq(TOPIC_NAME), eq(consumed));
validator.verify(kTable).transformValues(any(ValueTransformerWithKeySupplier.class));
verify(consumedFactory).create(keySerde, valueSerde);
verify(consumed).withTimestampExtractor(any());
verify(consumed).withOffsetResetPolicy(AutoOffsetReset.EARLIEST);
verify(kTable, never()).mapValues(any(ValueMapper.class), any(Materialized.class));
}
use of io.confluent.ksql.execution.plan.PlanInfo in project ksql by confluentinc.
the class PlanInfoExtractorTest method shouldExtractMultipleSources.
@Test
public void shouldExtractMultipleSources() {
// When:
final PlanInfo planInfo = streamAndTableJoined.extractPlanInfo(planInfoExtractor);
// Then:
assertThat(planInfo.isRepartitionedInPlan(streamSource), is(false));
assertThat(planInfo.isRepartitionedInPlan(tableSource), is(false));
}
use of io.confluent.ksql.execution.plan.PlanInfo in project ksql by confluentinc.
the class PlanInfoExtractorTest method shouldExtractRepartitionBeforeJoin.
@Test
public void shouldExtractRepartitionBeforeJoin() {
// When:
final PlanInfo planInfo = streamRepartitionedAndTableJoined.extractPlanInfo(planInfoExtractor);
// Then:
assertThat(planInfo.isRepartitionedInPlan(streamSource), is(true));
assertThat(planInfo.isRepartitionedInPlan(tableSource), is(false));
}
use of io.confluent.ksql.execution.plan.PlanInfo in project ksql by confluentinc.
the class PlanInfoExtractorTest method shouldExtractRepartitionAfterJoin.
@Test
public void shouldExtractRepartitionAfterJoin() {
// When:
final PlanInfo planInfo = streamAndTableJoinedRepartitioned.extractPlanInfo(planInfoExtractor);
// Then:
assertThat(planInfo.isRepartitionedInPlan(streamSource), is(false));
assertThat(planInfo.isRepartitionedInPlan(tableSource), is(false));
}
use of io.confluent.ksql.execution.plan.PlanInfo in project ksql by confluentinc.
the class SourceBuilderTest method givenDownstreamRepartition.
private static PlanInfo givenDownstreamRepartition(final ExecutionStep<?> sourceStep) {
final PlanInfo mockPlanInfo = mock(PlanInfo.class);
when(mockPlanInfo.isRepartitionedInPlan(sourceStep)).thenReturn(true);
return mockPlanInfo;
}
Aggregations