Search in sources :

Example 16 with Term

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

the class TermCompiler method visitComparisonExpression.

@Override
public Term visitComparisonExpression(final ComparisonExpression node, final Context context) {
    final Term left = process(node.getLeft(), context);
    final Term right = process(node.getRight(), context);
    return ComparisonInterpreter.doComparison(node.getType(), left, right);
}
Also used : 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)

Example 17 with Term

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

the class TermCompiler method visitCast.

@Override
public Term visitCast(final Cast node, final Context context) {
    final Term term = process(node.getExpression(), context);
    final SqlType from = term.getSqlType();
    final SqlType to = node.getType().getSqlType();
    return CastInterpreter.cast(term, from, to, ksqlConfig);
}
Also used : SqlType(io.confluent.ksql.schema.ksql.types.SqlType) 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)

Aggregations

Term (io.confluent.ksql.execution.interpreter.terms.Term)17 ColumnReferenceTerm (io.confluent.ksql.execution.interpreter.terms.ColumnReferenceTerm)14 CreateArrayTerm (io.confluent.ksql.execution.interpreter.terms.CreateArrayTerm)14 CreateMapTerm (io.confluent.ksql.execution.interpreter.terms.CreateMapTerm)14 DereferenceTerm (io.confluent.ksql.execution.interpreter.terms.DereferenceTerm)14 FunctionCallTerm (io.confluent.ksql.execution.interpreter.terms.FunctionCallTerm)14 InPredicateTerm (io.confluent.ksql.execution.interpreter.terms.InPredicateTerm)14 IsNotNullTerm (io.confluent.ksql.execution.interpreter.terms.IsNotNullTerm)14 IsNullTerm (io.confluent.ksql.execution.interpreter.terms.IsNullTerm)14 LambdaFunction1Term (io.confluent.ksql.execution.interpreter.terms.LambdaFunctionTerms.LambdaFunction1Term)14 LambdaFunction2Term (io.confluent.ksql.execution.interpreter.terms.LambdaFunctionTerms.LambdaFunction2Term)14 LambdaFunction3Term (io.confluent.ksql.execution.interpreter.terms.LambdaFunctionTerms.LambdaFunction3Term)14 LambdaVariableTerm (io.confluent.ksql.execution.interpreter.terms.LambdaVariableTerm)14 LikeTerm (io.confluent.ksql.execution.interpreter.terms.LikeTerm)14 NotTerm (io.confluent.ksql.execution.interpreter.terms.NotTerm)14 SearchedCaseTerm (io.confluent.ksql.execution.interpreter.terms.SearchedCaseTerm)14 StructTerm (io.confluent.ksql.execution.interpreter.terms.StructTerm)14 SubscriptTerm (io.confluent.ksql.execution.interpreter.terms.SubscriptTerm)14 SqlType (io.confluent.ksql.schema.ksql.types.SqlType)11 KsqlException (io.confluent.ksql.util.KsqlException)8