Search in sources :

Example 1 with StructTerm

use of io.confluent.ksql.execution.interpreter.terms.StructTerm in project ksql by confluentinc.

the class TermCompiler method visitStructExpression.

@Override
public Term visitStructExpression(final CreateStructExpression node, final Context context) {
    final ImmutableMap.Builder<String, Term> nameToTerm = ImmutableMap.builder();
    for (final Field field : node.getFields()) {
        nameToTerm.put(field.getName(), process(field.getValue(), context));
    }
    final SqlType resultType = expressionTypeManager.getExpressionSqlType(node, context.getLambdaSqlTypeMapping());
    return new StructTerm(nameToTerm.build(), resultType);
}
Also used : Field(io.confluent.ksql.execution.expression.tree.CreateStructExpression.Field) SqlType(io.confluent.ksql.schema.ksql.types.SqlType) StructTerm(io.confluent.ksql.execution.interpreter.terms.StructTerm) Term(io.confluent.ksql.execution.interpreter.terms.Term) LambdaFunction3Term(io.confluent.ksql.execution.interpreter.terms.LambdaFunctionTerms.LambdaFunction3Term) ColumnReferenceTerm(io.confluent.ksql.execution.interpreter.terms.ColumnReferenceTerm) LambdaFunction1Term(io.confluent.ksql.execution.interpreter.terms.LambdaFunctionTerms.LambdaFunction1Term) LikeTerm(io.confluent.ksql.execution.interpreter.terms.LikeTerm) FunctionCallTerm(io.confluent.ksql.execution.interpreter.terms.FunctionCallTerm) SearchedCaseTerm(io.confluent.ksql.execution.interpreter.terms.SearchedCaseTerm) StructTerm(io.confluent.ksql.execution.interpreter.terms.StructTerm) LambdaVariableTerm(io.confluent.ksql.execution.interpreter.terms.LambdaVariableTerm) CreateMapTerm(io.confluent.ksql.execution.interpreter.terms.CreateMapTerm) LambdaFunction2Term(io.confluent.ksql.execution.interpreter.terms.LambdaFunctionTerms.LambdaFunction2Term) SubscriptTerm(io.confluent.ksql.execution.interpreter.terms.SubscriptTerm) NotTerm(io.confluent.ksql.execution.interpreter.terms.NotTerm) IsNullTerm(io.confluent.ksql.execution.interpreter.terms.IsNullTerm) CreateArrayTerm(io.confluent.ksql.execution.interpreter.terms.CreateArrayTerm) DereferenceTerm(io.confluent.ksql.execution.interpreter.terms.DereferenceTerm) IsNotNullTerm(io.confluent.ksql.execution.interpreter.terms.IsNotNullTerm) InPredicateTerm(io.confluent.ksql.execution.interpreter.terms.InPredicateTerm) ImmutableMap(com.google.common.collect.ImmutableMap)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1 Field (io.confluent.ksql.execution.expression.tree.CreateStructExpression.Field)1 ColumnReferenceTerm (io.confluent.ksql.execution.interpreter.terms.ColumnReferenceTerm)1 CreateArrayTerm (io.confluent.ksql.execution.interpreter.terms.CreateArrayTerm)1 CreateMapTerm (io.confluent.ksql.execution.interpreter.terms.CreateMapTerm)1 DereferenceTerm (io.confluent.ksql.execution.interpreter.terms.DereferenceTerm)1 FunctionCallTerm (io.confluent.ksql.execution.interpreter.terms.FunctionCallTerm)1 InPredicateTerm (io.confluent.ksql.execution.interpreter.terms.InPredicateTerm)1 IsNotNullTerm (io.confluent.ksql.execution.interpreter.terms.IsNotNullTerm)1 IsNullTerm (io.confluent.ksql.execution.interpreter.terms.IsNullTerm)1 LambdaFunction1Term (io.confluent.ksql.execution.interpreter.terms.LambdaFunctionTerms.LambdaFunction1Term)1 LambdaFunction2Term (io.confluent.ksql.execution.interpreter.terms.LambdaFunctionTerms.LambdaFunction2Term)1 LambdaFunction3Term (io.confluent.ksql.execution.interpreter.terms.LambdaFunctionTerms.LambdaFunction3Term)1 LambdaVariableTerm (io.confluent.ksql.execution.interpreter.terms.LambdaVariableTerm)1 LikeTerm (io.confluent.ksql.execution.interpreter.terms.LikeTerm)1 NotTerm (io.confluent.ksql.execution.interpreter.terms.NotTerm)1 SearchedCaseTerm (io.confluent.ksql.execution.interpreter.terms.SearchedCaseTerm)1 StructTerm (io.confluent.ksql.execution.interpreter.terms.StructTerm)1 SubscriptTerm (io.confluent.ksql.execution.interpreter.terms.SubscriptTerm)1 Term (io.confluent.ksql.execution.interpreter.terms.Term)1