use of io.confluent.ksql.execution.expression.tree.NotExpression in project ksql by confluentinc.
the class ExpressionTypeManagerTest method shouldEvaluateBooleanSchemaForNotLikeExpression.
@Test
public void shouldEvaluateBooleanSchemaForNotLikeExpression() {
final Expression expression = new NotExpression(new LikePredicate(COL1, new StringLiteral("%foo"), Optional.empty()));
final SqlType exprType0 = expressionTypeManager.getExpressionSqlType(expression);
assertThat(exprType0, is(SqlTypes.BOOLEAN));
}
use of io.confluent.ksql.execution.expression.tree.NotExpression in project ksql by confluentinc.
the class ExpressionTreeRewriterTest method shouldRewriteNotExpression.
@Test
public void shouldRewriteNotExpression() {
// Given:
final NotExpression parsed = parseExpression("NOT 1 < 2");
when(processor.apply(parsed.getValue(), context)).thenReturn(expr1);
// When:
final Expression rewritten = expressionRewriter.rewrite(parsed, context);
// Then:
assertThat(rewritten, equalTo(new NotExpression(parsed.getLocation(), expr1)));
}
Aggregations