Search in sources :

Example 1 with TableSource

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

the class SourceBuilderTest method givenUnwindowedSourceTable.

private void givenUnwindowedSourceTable() {
    when(buildContext.buildKeySerde(any(), any(), any())).thenReturn(keySerde);
    givenConsumed(consumed, keySerde);
    tableSource = new TableSource(new ExecutionStepPropertiesV1(ctx), TOPIC_NAME, formats, TIMESTAMP_COLUMN, SOURCE_SCHEMA, SystemColumns.ROWPARTITION_ROWOFFSET_PSEUDOCOLUMN_VERSION, formats);
}
Also used : TableSource(io.confluent.ksql.execution.plan.TableSource) ExecutionStepPropertiesV1(io.confluent.ksql.execution.plan.ExecutionStepPropertiesV1)

Example 2 with TableSource

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

the class StepSchemaResolverTest method shouldResolveSchemaForTableSource.

@Test
public void shouldResolveSchemaForTableSource() {
    // Given:
    final TableSource step = new TableSource(PROPERTIES, "foo", formats, Optional.empty(), SCHEMA, SystemColumns.CURRENT_PSEUDOCOLUMN_VERSION_NUMBER, formats);
    // When:
    final LogicalSchema result = resolver.resolve(step, SCHEMA);
    // Then:
    assertThat(result, is(SCHEMA.withPseudoAndKeyColsInValue(false)));
}
Also used : TableSource(io.confluent.ksql.execution.plan.TableSource) WindowedTableSource(io.confluent.ksql.execution.plan.WindowedTableSource) LogicalSchema(io.confluent.ksql.schema.ksql.LogicalSchema) Test(org.junit.Test)

Example 3 with TableSource

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

the class SourceBuilder method getPhysicalSchemaWithPseudoColumnsToMaterialize.

private static PhysicalSchema getPhysicalSchemaWithPseudoColumnsToMaterialize(final SourceStep<?> streamSource) {
    final Formats format = ((TableSource) streamSource).getStateStoreFormats();
    final LogicalSchema withPseudoCols = streamSource.getSourceSchema().withPseudoColumnsToMaterialize(streamSource.getPseudoColumnVersion());
    return PhysicalSchema.from(withPseudoCols, format.getKeyFeatures(), format.getValueFeatures());
}
Also used : TableSource(io.confluent.ksql.execution.plan.TableSource) LogicalSchema(io.confluent.ksql.schema.ksql.LogicalSchema) Formats(io.confluent.ksql.execution.plan.Formats)

Example 4 with TableSource

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

the class SourceBuilderTest method givenMultiColumnSourceTable.

private void givenMultiColumnSourceTable() {
    when(buildContext.buildKeySerde(any(), any(), any())).thenReturn(keySerde);
    givenConsumed(consumed, keySerde);
    tableSource = new TableSource(new ExecutionStepPropertiesV1(ctx), TOPIC_NAME, formats, TIMESTAMP_COLUMN, MULTI_COL_SOURCE_SCHEMA, SystemColumns.ROWPARTITION_ROWOFFSET_PSEUDOCOLUMN_VERSION, formats);
}
Also used : TableSource(io.confluent.ksql.execution.plan.TableSource) ExecutionStepPropertiesV1(io.confluent.ksql.execution.plan.ExecutionStepPropertiesV1)

Example 5 with TableSource

use of io.confluent.ksql.execution.plan.TableSource 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

TableSource (io.confluent.ksql.execution.plan.TableSource)5 ExecutionStepPropertiesV1 (io.confluent.ksql.execution.plan.ExecutionStepPropertiesV1)3 LogicalSchema (io.confluent.ksql.schema.ksql.LogicalSchema)2 Formats (io.confluent.ksql.execution.plan.Formats)1 PlanInfoExtractor (io.confluent.ksql.execution.plan.PlanInfoExtractor)1 StreamSource (io.confluent.ksql.execution.plan.StreamSource)1 WindowedTableSource (io.confluent.ksql.execution.plan.WindowedTableSource)1 Before (org.junit.Before)1 Test (org.junit.Test)1