Search in sources :

Example 16 with ExecutionStepPropertiesV1

use of io.confluent.ksql.execution.plan.ExecutionStepPropertiesV1 in project ksql by confluentinc.

the class StreamAggregateBuilderTest method givenUnwindowedAggregate.

@SuppressWarnings({ "unchecked", "rawtypes" })
private void givenUnwindowedAggregate() {
    when(materializedFactory.<GenericKey, KeyValueStore<Bytes, byte[]>>create(any(), any(), any())).thenReturn(materialized);
    when(groupedStream.aggregate(any(), any(), any(Materialized.class))).thenReturn(aggregated);
    when(aggregated.transformValues(any(), any(Named.class))).thenReturn((KTable) aggregatedWithResults);
    aggregate = new StreamAggregate(new ExecutionStepPropertiesV1(CTX), sourceStep, Formats.of(KEY_FORMAT, VALUE_FORMAT, SerdeFeatures.of(), SerdeFeatures.of()), NON_AGG_COLUMNS, FUNCTIONS);
}
Also used : Named(org.apache.kafka.streams.kstream.Named) ExecutionStepPropertiesV1(io.confluent.ksql.execution.plan.ExecutionStepPropertiesV1) KeyValueStore(org.apache.kafka.streams.state.KeyValueStore) GenericKey(io.confluent.ksql.GenericKey) Materialized(org.apache.kafka.streams.kstream.Materialized) StreamAggregate(io.confluent.ksql.execution.plan.StreamAggregate)

Example 17 with ExecutionStepPropertiesV1

use of io.confluent.ksql.execution.plan.ExecutionStepPropertiesV1 in project ksql by confluentinc.

the class StreamAggregateBuilderTest method givenTumblingWindowedAggregate.

private void givenTumblingWindowedAggregate() {
    givenTimeWindowedAggregate();
    windowedAggregate = new StreamWindowedAggregate(new ExecutionStepPropertiesV1(CTX), sourceStep, Formats.of(KEY_FORMAT, VALUE_FORMAT, SerdeFeatures.of(), SerdeFeatures.of()), NON_AGG_COLUMNS, FUNCTIONS, new TumblingWindowExpression(Optional.empty(), new WindowTimeClause(WINDOW.getSeconds(), TimeUnit.SECONDS), Optional.of(retentionClause), Optional.of(gracePeriodClause)));
}
Also used : ExecutionStepPropertiesV1(io.confluent.ksql.execution.plan.ExecutionStepPropertiesV1) StreamWindowedAggregate(io.confluent.ksql.execution.plan.StreamWindowedAggregate) WindowTimeClause(io.confluent.ksql.execution.windows.WindowTimeClause) TumblingWindowExpression(io.confluent.ksql.execution.windows.TumblingWindowExpression)

Example 18 with ExecutionStepPropertiesV1

use of io.confluent.ksql.execution.plan.ExecutionStepPropertiesV1 in project ksql by confluentinc.

the class PlanInfoExtractorTest method setUp.

@Before
public void setUp() {
    streamSource = new StreamSource(new ExecutionStepPropertiesV1(queryContext), "s1", formats, Optional.empty(), schema, OptionalInt.of(SystemColumns.CURRENT_PSEUDOCOLUMN_VERSION_NUMBER));
    tableSource = new TableSource(new ExecutionStepPropertiesV1(queryContext), "t1", formats, Optional.empty(), schema, SystemColumns.CURRENT_PSEUDOCOLUMN_VERSION_NUMBER, formats);
    streamSourceRepartitioned = new StreamSelectKey<>(new ExecutionStepPropertiesV1(queryContext), streamSource, ImmutableList.of(repartitionKey));
    streamAndTableJoined = new StreamTableJoin<>(new ExecutionStepPropertiesV1(queryContext), JoinType.LEFT, joinKey, formats, streamSource, tableSource);
    streamRepartitionedAndTableJoined = new StreamTableJoin<>(new ExecutionStepPropertiesV1(queryContext), JoinType.LEFT, joinKey, formats, streamSourceRepartitioned, tableSource);
    streamAndTableJoinedRepartitioned = new StreamSelectKey<>(new ExecutionStepPropertiesV1(queryContext), streamAndTableJoined, ImmutableList.of(repartitionKey));
    planInfoExtractor = new PlanInfoExtractor();
}
Also used : TableSource(io.confluent.ksql.execution.plan.TableSource) StreamSource(io.confluent.ksql.execution.plan.StreamSource) ExecutionStepPropertiesV1(io.confluent.ksql.execution.plan.ExecutionStepPropertiesV1) PlanInfoExtractor(io.confluent.ksql.execution.plan.PlanInfoExtractor) Before(org.junit.Before)

Aggregations

ExecutionStepPropertiesV1 (io.confluent.ksql.execution.plan.ExecutionStepPropertiesV1)18 Before (org.junit.Before)6 Named (org.apache.kafka.streams.kstream.Named)5 Materialized (org.apache.kafka.streams.kstream.Materialized)4 GenericKey (io.confluent.ksql.GenericKey)3 StreamSource (io.confluent.ksql.execution.plan.StreamSource)3 StreamWindowedAggregate (io.confluent.ksql.execution.plan.StreamWindowedAggregate)3 TableSource (io.confluent.ksql.execution.plan.TableSource)3 WindowedStreamSource (io.confluent.ksql.execution.plan.WindowedStreamSource)3 WindowTimeClause (io.confluent.ksql.execution.windows.WindowTimeClause)3 KeyValueStore (org.apache.kafka.streams.state.KeyValueStore)2 QueryContext (io.confluent.ksql.execution.context.QueryContext)1 PlanInfoExtractor (io.confluent.ksql.execution.plan.PlanInfoExtractor)1 StreamAggregate (io.confluent.ksql.execution.plan.StreamAggregate)1 StreamSelectKeyV1 (io.confluent.ksql.execution.plan.StreamSelectKeyV1)1 TableAggregate (io.confluent.ksql.execution.plan.TableAggregate)1 TableSourceV1 (io.confluent.ksql.execution.plan.TableSourceV1)1 WindowedTableSource (io.confluent.ksql.execution.plan.WindowedTableSource)1 HoppingWindowExpression (io.confluent.ksql.execution.windows.HoppingWindowExpression)1 SessionWindowExpression (io.confluent.ksql.execution.windows.SessionWindowExpression)1