Search in sources :

Example 76 with SqlType

use of io.confluent.ksql.schema.ksql.types.SqlType in project ksql by confluentinc.

the class QueryProjectNode method selectOutputSchema.

private LogicalSchema selectOutputSchema(final MetaStore metaStore, final List<SelectExpression> selectExpressions, final boolean isWindowed) {
    final Builder schemaBuilder = LogicalSchema.builder();
    final LogicalSchema parentSchema = getSource().getSchema();
    // Copy meta & key columns into the value schema as SelectValueMapper expects it:
    final LogicalSchema schema = parentSchema.withPseudoAndKeyColsInValue(isWindowed, ksqlConfig);
    final ExpressionTypeManager expressionTypeManager = new ExpressionTypeManager(schema, metaStore);
    for (final SelectExpression select : selectExpressions) {
        final SqlType type = expressionTypeManager.getExpressionSqlType(select.getExpression());
        if (parentSchema.isKeyColumn(select.getAlias()) || select.getAlias().equals(SystemColumns.WINDOWSTART_NAME) || select.getAlias().equals(SystemColumns.WINDOWEND_NAME)) {
            schemaBuilder.keyColumn(select.getAlias(), type);
        } else {
            schemaBuilder.valueColumn(select.getAlias(), type);
        }
    }
    return schemaBuilder.build();
}
Also used : ExpressionTypeManager(io.confluent.ksql.execution.util.ExpressionTypeManager) Builder(io.confluent.ksql.schema.ksql.LogicalSchema.Builder) LogicalSchema(io.confluent.ksql.schema.ksql.LogicalSchema) SqlType(io.confluent.ksql.schema.ksql.types.SqlType) SelectExpression(io.confluent.ksql.execution.plan.SelectExpression)

Example 77 with SqlType

use of io.confluent.ksql.schema.ksql.types.SqlType in project ksql by confluentinc.

the class LogicalPlanner method buildAggregateSchema.

private LogicalSchema buildAggregateSchema(final PlanNode sourcePlanNode, final GroupBy groupBy, final List<SelectExpression> projectionExpressions) {
    final LogicalSchema sourceSchema = sourcePlanNode.getSchema();
    final LogicalSchema projectionSchema = SelectionUtil.buildProjectionSchema(sourceSchema.withPseudoAndKeyColsInValue(analysis.getWindowExpression().isPresent(), ksqlConfig), projectionExpressions, metaStore);
    final List<Expression> groupByExps = groupBy.getGroupingExpressions();
    final Function<Expression, Optional<ColumnName>> selectResolver = expression -> {
        final List<ColumnName> foundInProjection = projectionExpressions.stream().filter(e -> e.getExpression().equals(expression)).map(SelectExpression::getAlias).collect(Collectors.toList());
        switch(foundInProjection.size()) {
            case 0:
                return Optional.empty();
            case 1:
                return Optional.of(foundInProjection.get(0));
            default:
                final String keys = GrammaticalJoiner.and().join(foundInProjection);
                throw new KsqlException("The projection contains a key column more than once: " + keys + "." + System.lineSeparator() + "Each key column must only be in the projection once. " + "If you intended to copy the key into the value, then consider using the " + AsValue.NAME + " function to indicate which key reference should be copied.");
        }
    };
    final List<Column> valueColumns;
    if (analysis.getInto().isPresent()) {
        // Persistent query:
        final Set<ColumnName> keyColumnNames = groupBy.getGroupingExpressions().stream().map(selectResolver).filter(Optional::isPresent).map(Optional::get).collect(Collectors.toSet());
        valueColumns = projectionSchema.value().stream().filter(col -> !keyColumnNames.contains(col.name())).collect(Collectors.toList());
        if (valueColumns.isEmpty()) {
            throw new KsqlException("The projection contains no value columns.");
        }
    } else {
        // Transient query:
        // Transient queries only return value columns, so must have key columns in the value:
        valueColumns = projectionSchema.columns();
    }
    final Builder builder = LogicalSchema.builder();
    final ExpressionTypeManager typeManager = new ExpressionTypeManager(sourceSchema, metaStore);
    for (final Expression expression : groupByExps) {
        final SqlType keyType = typeManager.getExpressionSqlType(expression);
        final ColumnName keyName = selectResolver.apply(expression).orElseGet(() -> expression instanceof ColumnReferenceExp ? ((ColumnReferenceExp) expression).getColumnName() : ColumnNames.uniqueAliasFor(expression, sourceSchema));
        builder.keyColumn(keyName, keyType);
    }
    return builder.valueColumns(valueColumns).build();
}
Also used : JoinInfo(io.confluent.ksql.analyzer.Analysis.JoinInfo) DataSource(io.confluent.ksql.metastore.model.DataSource) Leaf(io.confluent.ksql.planner.JoinTree.Leaf) AggregateAnalysisResult(io.confluent.ksql.analyzer.AggregateAnalysisResult) Into(io.confluent.ksql.analyzer.Analysis.Into) ColumnName(io.confluent.ksql.name.ColumnName) SourceName(io.confluent.ksql.name.SourceName) BiFunction(java.util.function.BiFunction) AggregateAnalyzer(io.confluent.ksql.analyzer.AggregateAnalyzer) FilterNode(io.confluent.ksql.planner.plan.FilterNode) SerdeFeaturesFactory(io.confluent.ksql.serde.SerdeFeaturesFactory) JoinKey(io.confluent.ksql.planner.plan.JoinNode.JoinKey) CodeGenRunner(io.confluent.ksql.execution.codegen.CodeGenRunner) WindowInfo(io.confluent.ksql.serde.WindowInfo) RewrittenAnalysis(io.confluent.ksql.analyzer.RewrittenAnalysis) QueryLimitNode(io.confluent.ksql.planner.plan.QueryLimitNode) AggregateNode(io.confluent.ksql.planner.plan.AggregateNode) AliasedDataSource(io.confluent.ksql.analyzer.Analysis.AliasedDataSource) TimestampExtractionPolicyFactory(io.confluent.ksql.execution.streams.timestamp.TimestampExtractionPolicyFactory) ExpressionTypeManager(io.confluent.ksql.execution.util.ExpressionTypeManager) KsqlBareOutputNode(io.confluent.ksql.planner.plan.KsqlBareOutputNode) SelectionUtil(io.confluent.ksql.planner.plan.SelectionUtil) PartitionBy(io.confluent.ksql.parser.tree.PartitionBy) ColumnReferenceExp(io.confluent.ksql.execution.expression.tree.ColumnReferenceExp) PreJoinProjectNode(io.confluent.ksql.planner.plan.PreJoinProjectNode) VisitParentExpressionVisitor(io.confluent.ksql.execution.expression.tree.VisitParentExpressionVisitor) FinalProjectNode(io.confluent.ksql.planner.plan.FinalProjectNode) ColumnNames(io.confluent.ksql.schema.ksql.ColumnNames) RefinementInfo(io.confluent.ksql.serde.RefinementInfo) ImmutableAnalysis(io.confluent.ksql.analyzer.ImmutableAnalysis) ExpressionEvaluator(io.confluent.ksql.execution.transform.ExpressionEvaluator) Expression(io.confluent.ksql.execution.expression.tree.Expression) JoinType(io.confluent.ksql.planner.plan.JoinNode.JoinType) Set(java.util.Set) QueryFilterNode(io.confluent.ksql.planner.plan.QueryFilterNode) KsqlConfig(io.confluent.ksql.util.KsqlConfig) LogicalSchema(io.confluent.ksql.schema.ksql.LogicalSchema) Collectors(java.util.stream.Collectors) TimestampColumn(io.confluent.ksql.execution.timestamp.TimestampColumn) PlanNodeId(io.confluent.ksql.planner.plan.PlanNodeId) SingleSourcePlanNode(io.confluent.ksql.planner.plan.SingleSourcePlanNode) Builder(io.confluent.ksql.schema.ksql.LogicalSchema.Builder) Objects(java.util.Objects) Join(io.confluent.ksql.planner.JoinTree.Join) List(java.util.List) KsqlException(io.confluent.ksql.util.KsqlException) Optional(java.util.Optional) QueryProjectNode(io.confluent.ksql.planner.plan.QueryProjectNode) Column(io.confluent.ksql.schema.ksql.Column) FormatInfo(io.confluent.ksql.serde.FormatInfo) ProjectNode(io.confluent.ksql.planner.plan.ProjectNode) Iterables(com.google.common.collect.Iterables) FormatFactory(io.confluent.ksql.serde.FormatFactory) GrammaticalJoiner(io.confluent.ksql.util.GrammaticalJoiner) KeyFormat(io.confluent.ksql.serde.KeyFormat) JoinNode(io.confluent.ksql.planner.plan.JoinNode) SuppressNode(io.confluent.ksql.planner.plan.SuppressNode) UnqualifiedColumnReferenceExp(io.confluent.ksql.execution.expression.tree.UnqualifiedColumnReferenceExp) PartitionByParamsFactory(io.confluent.ksql.execution.streams.PartitionByParamsFactory) DataSourceType(io.confluent.ksql.metastore.model.DataSource.DataSourceType) Function(java.util.function.Function) NoneFormat(io.confluent.ksql.serde.none.NoneFormat) AsValue(io.confluent.ksql.function.udf.AsValue) QualifiedColumnReferenceExp(io.confluent.ksql.execution.expression.tree.QualifiedColumnReferenceExp) MetaStore(io.confluent.ksql.metastore.MetaStore) GroupBy(io.confluent.ksql.parser.tree.GroupBy) KsqlStructuredDataOutputNode(io.confluent.ksql.planner.plan.KsqlStructuredDataOutputNode) UserRepartitionNode(io.confluent.ksql.planner.plan.UserRepartitionNode) WindowExpression(io.confluent.ksql.parser.tree.WindowExpression) SqlType(io.confluent.ksql.schema.ksql.types.SqlType) SerdeFeatures(io.confluent.ksql.serde.SerdeFeatures) DataSourceNode(io.confluent.ksql.planner.plan.DataSourceNode) NewTopic(io.confluent.ksql.analyzer.Analysis.Into.NewTopic) KsqlWindowExpression(io.confluent.ksql.execution.windows.KsqlWindowExpression) OutputNode(io.confluent.ksql.planner.plan.OutputNode) FilterTypeValidator(io.confluent.ksql.analyzer.FilterTypeValidator) FlatMapNode(io.confluent.ksql.planner.plan.FlatMapNode) ValueFormat(io.confluent.ksql.serde.ValueFormat) SelectExpression(io.confluent.ksql.execution.plan.SelectExpression) NodeLocation(io.confluent.ksql.parser.NodeLocation) PreJoinRepartitionNode(io.confluent.ksql.planner.plan.PreJoinRepartitionNode) FunctionCall(io.confluent.ksql.execution.expression.tree.FunctionCall) KsqlTopic(io.confluent.ksql.execution.ddl.commands.KsqlTopic) PlanNode(io.confluent.ksql.planner.plan.PlanNode) Context(io.confluent.ksql.engine.rewrite.ExpressionTreeRewriter.Context) ExpressionTreeRewriter(io.confluent.ksql.engine.rewrite.ExpressionTreeRewriter) OutputRefinement(io.confluent.ksql.parser.OutputRefinement) FilterType(io.confluent.ksql.analyzer.FilterTypeValidator.FilterType) Collections(java.util.Collections) ExpressionTypeManager(io.confluent.ksql.execution.util.ExpressionTypeManager) Optional(java.util.Optional) Builder(io.confluent.ksql.schema.ksql.LogicalSchema.Builder) LogicalSchema(io.confluent.ksql.schema.ksql.LogicalSchema) SelectExpression(io.confluent.ksql.execution.plan.SelectExpression) KsqlException(io.confluent.ksql.util.KsqlException) ColumnName(io.confluent.ksql.name.ColumnName) ColumnReferenceExp(io.confluent.ksql.execution.expression.tree.ColumnReferenceExp) UnqualifiedColumnReferenceExp(io.confluent.ksql.execution.expression.tree.UnqualifiedColumnReferenceExp) QualifiedColumnReferenceExp(io.confluent.ksql.execution.expression.tree.QualifiedColumnReferenceExp) Expression(io.confluent.ksql.execution.expression.tree.Expression) WindowExpression(io.confluent.ksql.parser.tree.WindowExpression) KsqlWindowExpression(io.confluent.ksql.execution.windows.KsqlWindowExpression) SelectExpression(io.confluent.ksql.execution.plan.SelectExpression) TimestampColumn(io.confluent.ksql.execution.timestamp.TimestampColumn) Column(io.confluent.ksql.schema.ksql.Column) List(java.util.List) SqlType(io.confluent.ksql.schema.ksql.types.SqlType)

Example 78 with SqlType

use of io.confluent.ksql.schema.ksql.types.SqlType in project ksql by confluentinc.

the class SelectionUtil method buildProjectionSchema.

/*
   * The algorithm behind this method feels unnecessarily complicated and is begging
   * for someone to come along and improve it, but until that time here is
   * a description of what's going on.
   *
   * Essentially, we need to build a logical schema that mirrors the physical
   * schema until https://github.com/confluentinc/ksql/issues/6374 is addressed.
   * That means that the keys must be ordered in the same way as the parent schema
   * (e.g. if the source schema was K1 INT KEY, K2 INT KEY and the projection is
   * SELECT K2, K1 this method will produce an output schema that is K1, K2
   * despite the way that the keys were ordered in the projection) - see
   * https://github.com/confluentinc/ksql/pull/7477 for context on the bug.
   *
   * But we cannot simply select all the keys and then the values, we must maintain
   * the interleaving of key and values because transient queries return all columns
   * to the user as "value columns". If someone issues a SELECT VALUE, * FROM FOO
   * it is expected that VALUE shows up _before_ the key fields. This means we need to
   * reorder the key columns within the list of projections without affecting the
   * relative order the keys/values.
   *
   * To spice things up even further, there's the possibility that the same key is
   * aliased multiple times (SELECT K1 AS X, K2 AS Y FROM ...), which is not supported
   * but is verified later when building the final projection - so we maintain it here.
   *
   * Now on to the algorithm itself: we make two passes through the list of projections.
   * The first pass builds a mapping from source key to all the projections for that key.
   * We will use this mapping to sort the keys in the second pass. This mapping is two
   * dimensional to address the possibility of the same key with multiple aliases.
   *
   * The second pass goes through the list of projections again and builds the logical schema,
   * but this time if we encounter a projection that references a key column, we instead take
   * it from the list we built in the first pass (in order defined by the parent schema).
   */
public static LogicalSchema buildProjectionSchema(final LogicalSchema parentSchema, final List<SelectExpression> projection, final FunctionRegistry functionRegistry) {
    final ExpressionTypeManager expressionTypeManager = new ExpressionTypeManager(parentSchema, functionRegistry);
    // keyExpressions[i] represents the expressions found in projection
    // that are associated with parentSchema's key at index i
    final List<List<SelectExpression>> keyExpressions = new ArrayList<>(parentSchema.key().size());
    for (int i = 0; i < parentSchema.key().size(); i++) {
        keyExpressions.add(new ArrayList<>());
    }
    // first pass to construct keyExpressions, keyExpressionMembership
    // is just a convenience data structure so that we don't have to do
    // the isKey check in the second iteration below
    final Set<SelectExpression> keyExpressionMembership = new HashSet<>();
    for (final SelectExpression select : projection) {
        final Expression expression = select.getExpression();
        if (expression instanceof ColumnReferenceExp) {
            final ColumnName name = ((ColumnReferenceExp) expression).getColumnName();
            parentSchema.findColumn(name).filter(c -> c.namespace() == Namespace.KEY).ifPresent(c -> {
                keyExpressions.get(c.index()).add(select);
                keyExpressionMembership.add(select);
            });
        }
    }
    // second pass, which iterates the projections but ignores any key expressions,
    // instead taking them from the ordered keyExpressions list
    final Builder builder = LogicalSchema.builder();
    int currKeyIdx = 0;
    for (final SelectExpression select : projection) {
        if (keyExpressionMembership.contains(select)) {
            while (keyExpressions.get(currKeyIdx).isEmpty()) {
                currKeyIdx++;
            }
            final SelectExpression keyExp = keyExpressions.get(currKeyIdx).remove(0);
            final SqlType type = expressionTypeManager.getExpressionSqlType(keyExp.getExpression());
            builder.keyColumn(keyExp.getAlias(), type);
        } else {
            final Expression expression = select.getExpression();
            final SqlType type = expressionTypeManager.getExpressionSqlType(expression);
            if (type == null) {
                throw new IllegalArgumentException("Can't infer a type of null. Please explicitly cast " + "it to a required type, e.g. CAST(null AS VARCHAR).");
            }
            builder.valueColumn(select.getAlias(), type);
        }
    }
    return builder.build();
}
Also used : IntStream(java.util.stream.IntStream) Expression(io.confluent.ksql.execution.expression.tree.Expression) ColumnName(io.confluent.ksql.name.ColumnName) FunctionRegistry(io.confluent.ksql.function.FunctionRegistry) UnqualifiedColumnReferenceExp(io.confluent.ksql.execution.expression.tree.UnqualifiedColumnReferenceExp) Set(java.util.Set) LogicalSchema(io.confluent.ksql.schema.ksql.LogicalSchema) Collectors(java.util.stream.Collectors) SelectExpression(io.confluent.ksql.execution.plan.SelectExpression) SelectItem(io.confluent.ksql.parser.tree.SelectItem) Namespace(io.confluent.ksql.schema.ksql.Column.Namespace) Builder(io.confluent.ksql.schema.ksql.LogicalSchema.Builder) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) List(java.util.List) SingleColumn(io.confluent.ksql.parser.tree.SingleColumn) Stream(java.util.stream.Stream) ExpressionTypeManager(io.confluent.ksql.execution.util.ExpressionTypeManager) Optional(java.util.Optional) AllColumns(io.confluent.ksql.parser.tree.AllColumns) ColumnReferenceExp(io.confluent.ksql.execution.expression.tree.ColumnReferenceExp) Column(io.confluent.ksql.schema.ksql.Column) SqlType(io.confluent.ksql.schema.ksql.types.SqlType) ExpressionTypeManager(io.confluent.ksql.execution.util.ExpressionTypeManager) Builder(io.confluent.ksql.schema.ksql.LogicalSchema.Builder) ArrayList(java.util.ArrayList) SelectExpression(io.confluent.ksql.execution.plan.SelectExpression) UnqualifiedColumnReferenceExp(io.confluent.ksql.execution.expression.tree.UnqualifiedColumnReferenceExp) ColumnReferenceExp(io.confluent.ksql.execution.expression.tree.ColumnReferenceExp) ColumnName(io.confluent.ksql.name.ColumnName) Expression(io.confluent.ksql.execution.expression.tree.Expression) SelectExpression(io.confluent.ksql.execution.plan.SelectExpression) ArrayList(java.util.ArrayList) List(java.util.List) SqlType(io.confluent.ksql.schema.ksql.types.SqlType) HashSet(java.util.HashSet)

Example 79 with SqlType

use of io.confluent.ksql.schema.ksql.types.SqlType in project ksql by confluentinc.

the class UdafUtil method resolveAggregateFunction.

public static KsqlAggregateFunction<?, ?, ?> resolveAggregateFunction(final FunctionRegistry functionRegistry, final FunctionCall functionCall, final LogicalSchema schema, final KsqlConfig config) {
    try {
        final ExpressionTypeManager expressionTypeManager = new ExpressionTypeManager(schema, functionRegistry);
        final SqlType argumentType = expressionTypeManager.getExpressionSqlType(functionCall.getArguments().get(0));
        // UDAFs only support one non-constant argument, and that argument must be a column reference
        final Expression arg = functionCall.getArguments().get(0);
        final Optional<Column> possibleValueColumn = arg instanceof UnqualifiedColumnReferenceExp ? schema.findValueColumn(((UnqualifiedColumnReferenceExp) arg).getColumnName()) : // assume that it is a column reference with no alias
        schema.findValueColumn(ColumnName.of(arg.toString()));
        final Column valueColumn = possibleValueColumn.orElseThrow(() -> new KsqlException("Could not find column for expression: " + arg));
        final AggregateFunctionInitArguments aggregateFunctionInitArguments = createAggregateFunctionInitArgs(valueColumn.index(), functionCall, config);
        return functionRegistry.getAggregateFunction(functionCall.getName(), argumentType, aggregateFunctionInitArguments);
    } catch (final Exception e) {
        throw new KsqlException("Failed to create aggregate function: " + functionCall, e);
    }
}
Also used : ExpressionTypeManager(io.confluent.ksql.execution.util.ExpressionTypeManager) AggregateFunctionInitArguments(io.confluent.ksql.function.AggregateFunctionInitArguments) Expression(io.confluent.ksql.execution.expression.tree.Expression) Column(io.confluent.ksql.schema.ksql.Column) SqlType(io.confluent.ksql.schema.ksql.types.SqlType) KsqlException(io.confluent.ksql.util.KsqlException) UnqualifiedColumnReferenceExp(io.confluent.ksql.execution.expression.tree.UnqualifiedColumnReferenceExp) KsqlException(io.confluent.ksql.util.KsqlException)

Example 80 with SqlType

use of io.confluent.ksql.schema.ksql.types.SqlType in project ksql by confluentinc.

the class ArithmeticInterpreter method getNonDecimalArithmeticFunction.

private static ArithmeticBinaryFunction getNonDecimalArithmeticFunction(final Operator operator, final SqlType leftType, final SqlType rightType) {
    final SqlBaseType leftBaseType = leftType.baseType();
    final SqlBaseType rightBaseType = rightType.baseType();
    if (leftBaseType == SqlBaseType.STRING && rightBaseType == SqlBaseType.STRING) {
        return (o1, o2) -> (String) o1 + (String) o2;
    } else if (leftBaseType == SqlBaseType.DOUBLE || rightBaseType == SqlBaseType.DOUBLE) {
        final TypedArithmeticBinaryFunction<Double> fn = getDoubleFunction(operator);
        final ComparableCastFunction<Double> castLeft = castToDoubleFunction(leftType);
        final ComparableCastFunction<Double> castRight = castToDoubleFunction(rightType);
        return (o1, o2) -> fn.doFunction(castLeft.cast(o1), castRight.cast(o2));
    } else if (leftBaseType == SqlBaseType.BIGINT || rightBaseType == SqlBaseType.BIGINT) {
        final TypedArithmeticBinaryFunction<Long> fn = getLongFunction(operator);
        final ComparableCastFunction<Long> castLeft = castToLongFunction(leftType);
        final ComparableCastFunction<Long> castRight = castToLongFunction(rightType);
        return (o1, o2) -> fn.doFunction(castLeft.cast(o1), castRight.cast(o2));
    } else if (leftBaseType == SqlBaseType.INTEGER || rightBaseType == SqlBaseType.INTEGER) {
        final TypedArithmeticBinaryFunction<Integer> fn = getIntegerFunction(operator);
        final ComparableCastFunction<Integer> castLeft = castToIntegerFunction(leftType);
        final ComparableCastFunction<Integer> castRight = castToIntegerFunction(rightType);
        return (o1, o2) -> fn.doFunction(castLeft.cast(o1), castRight.cast(o2));
    } else {
        throw new KsqlException("Can't do arithmetic for types " + leftType + " and " + rightType);
    }
}
Also used : CastInterpreter.castToLongFunction(io.confluent.ksql.execution.interpreter.CastInterpreter.castToLongFunction) CastTerm(io.confluent.ksql.execution.interpreter.terms.CastTerm) DecimalUtil(io.confluent.ksql.util.DecimalUtil) ArithmeticBinaryTerm(io.confluent.ksql.execution.interpreter.terms.ArithmeticBinaryTerm) CastInterpreter.castToDoubleFunction(io.confluent.ksql.execution.interpreter.CastInterpreter.castToDoubleFunction) MathContext(java.math.MathContext) CastInterpreter.castToIntegerFunction(io.confluent.ksql.execution.interpreter.CastInterpreter.castToIntegerFunction) KsqlConfig(io.confluent.ksql.util.KsqlConfig) SqlBaseType(io.confluent.ksql.schema.ksql.types.SqlBaseType) ArithmeticUnaryFunction(io.confluent.ksql.execution.interpreter.terms.ArithmeticUnaryTerm.ArithmeticUnaryFunction) BigDecimal(java.math.BigDecimal) Sign(io.confluent.ksql.execution.expression.tree.ArithmeticUnaryExpression.Sign) ArithmeticBinaryFunction(io.confluent.ksql.execution.interpreter.terms.ArithmeticBinaryTerm.ArithmeticBinaryFunction) ArithmeticUnaryTerm(io.confluent.ksql.execution.interpreter.terms.ArithmeticUnaryTerm) ComparableCastFunction(io.confluent.ksql.execution.interpreter.terms.CastTerm.ComparableCastFunction) Term(io.confluent.ksql.execution.interpreter.terms.Term) SqlDecimal(io.confluent.ksql.schema.ksql.types.SqlDecimal) Operator(io.confluent.ksql.schema.Operator) KsqlException(io.confluent.ksql.util.KsqlException) SqlType(io.confluent.ksql.schema.ksql.types.SqlType) SqlTypes(io.confluent.ksql.schema.ksql.types.SqlTypes) RoundingMode(java.math.RoundingMode) ComparableCastFunction(io.confluent.ksql.execution.interpreter.terms.CastTerm.ComparableCastFunction) SqlBaseType(io.confluent.ksql.schema.ksql.types.SqlBaseType) KsqlException(io.confluent.ksql.util.KsqlException)

Aggregations

SqlType (io.confluent.ksql.schema.ksql.types.SqlType)140 Test (org.junit.Test)80 Expression (io.confluent.ksql.execution.expression.tree.Expression)47 CreateStructExpression (io.confluent.ksql.execution.expression.tree.CreateStructExpression)38 KsqlException (io.confluent.ksql.util.KsqlException)33 InListExpression (io.confluent.ksql.execution.expression.tree.InListExpression)30 ArithmeticBinaryExpression (io.confluent.ksql.execution.expression.tree.ArithmeticBinaryExpression)29 ComparisonExpression (io.confluent.ksql.execution.expression.tree.ComparisonExpression)29 CreateArrayExpression (io.confluent.ksql.execution.expression.tree.CreateArrayExpression)29 CreateMapExpression (io.confluent.ksql.execution.expression.tree.CreateMapExpression)29 DereferenceExpression (io.confluent.ksql.execution.expression.tree.DereferenceExpression)29 NotExpression (io.confluent.ksql.execution.expression.tree.NotExpression)29 SearchedCaseExpression (io.confluent.ksql.execution.expression.tree.SearchedCaseExpression)29 SimpleCaseExpression (io.confluent.ksql.execution.expression.tree.SimpleCaseExpression)29 SubscriptExpression (io.confluent.ksql.execution.expression.tree.SubscriptExpression)29 Optional (java.util.Optional)20 StringLiteral (io.confluent.ksql.execution.expression.tree.StringLiteral)15 Result (io.confluent.ksql.schema.ksql.SqlValueCoercer.Result)14 Struct (org.apache.kafka.connect.data.Struct)14 IntegerLiteral (io.confluent.ksql.execution.expression.tree.IntegerLiteral)13