Search in sources :

Example 21 with Builder

use of io.confluent.ksql.schema.ksql.LogicalSchema.Builder in project ksql by confluentinc.

the class QueryStreamHandler method preparePushProjectionSchema.

private LogicalSchema preparePushProjectionSchema(final LogicalSchema schema) {
    final Builder projectionSchema = LogicalSchema.builder();
    schema.value().forEach(projectionSchema::valueColumn);
    return projectionSchema.build();
}
Also used : Builder(io.confluent.ksql.schema.ksql.LogicalSchema.Builder)

Example 22 with Builder

use of io.confluent.ksql.schema.ksql.LogicalSchema.Builder in project ksql by confluentinc.

the class PushQueryPublisher method valueColumnOnly.

private static LogicalSchema valueColumnOnly(final LogicalSchema logicalSchema) {
    // Push queries only return value columns, but query metadata schema includes key and meta:
    final Builder builder = LogicalSchema.builder();
    logicalSchema.value().forEach(builder::valueColumn);
    return builder.build();
}
Also used : Builder(io.confluent.ksql.schema.ksql.LogicalSchema.Builder)

Aggregations

Builder (io.confluent.ksql.schema.ksql.LogicalSchema.Builder)22 KsqlException (io.confluent.ksql.util.KsqlException)9 Test (org.junit.Test)9 SqlType (io.confluent.ksql.schema.ksql.types.SqlType)7 LogicalSchema (io.confluent.ksql.schema.ksql.LogicalSchema)6 SelectExpression (io.confluent.ksql.execution.plan.SelectExpression)5 ExpressionTypeManager (io.confluent.ksql.execution.util.ExpressionTypeManager)5 ColumnName (io.confluent.ksql.name.ColumnName)4 List (java.util.List)4 Optional (java.util.Optional)4 Collectors (java.util.stream.Collectors)4 ColumnReferenceExp (io.confluent.ksql.execution.expression.tree.ColumnReferenceExp)3 Expression (io.confluent.ksql.execution.expression.tree.Expression)3 UnqualifiedColumnReferenceExp (io.confluent.ksql.execution.expression.tree.UnqualifiedColumnReferenceExp)3 ImmutableList (com.google.common.collect.ImmutableList)2 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)2 RewrittenAnalysis (io.confluent.ksql.analyzer.RewrittenAnalysis)2 CodeGenRunner (io.confluent.ksql.execution.codegen.CodeGenRunner)2 ExpressionEvaluator (io.confluent.ksql.execution.transform.ExpressionEvaluator)2 MetaStore (io.confluent.ksql.metastore.MetaStore)2