use of io.confluent.ksql.execution.expression.tree.NullLiteral in project ksql by confluentinc.
the class InterpretedExpressionTest method shouldEvaluateIsNullPredicate.
@Test
public void shouldEvaluateIsNullPredicate() {
// Given:
final Expression expression1 = new IsNullPredicate(COL11);
final Expression expression2 = new IsNullPredicate(new NullLiteral());
// When:
InterpretedExpression interpreter1 = interpreter(expression1);
InterpretedExpression interpreter2 = interpreter(expression2);
// Then:
assertThat(interpreter1.evaluate(make(11, true)), is(false));
assertThat(interpreter1.evaluate(make(11, null)), is(true));
assertThat(interpreter2.evaluate(ROW), is(true));
}
use of io.confluent.ksql.execution.expression.tree.NullLiteral in project ksql by confluentinc.
the class InterpretedExpressionTest method shouldEvaluateIsNotNullPredicate.
@Test
public void shouldEvaluateIsNotNullPredicate() {
// Given:
final Expression expression1 = new IsNotNullPredicate(COL11);
final Expression expression2 = new IsNotNullPredicate(new NullLiteral());
// When:
InterpretedExpression interpreter1 = interpreter(expression1);
InterpretedExpression interpreter2 = interpreter(expression2);
// Then:
assertThat(interpreter1.evaluate(make(11, true)), is(true));
assertThat(interpreter1.evaluate(make(11, null)), is(false));
assertThat(interpreter2.evaluate(ROW), is(false));
}
use of io.confluent.ksql.execution.expression.tree.NullLiteral in project ksql by confluentinc.
the class GenericExpressionResolverTest method shouldResolveNullLiteral.
@Test
public void shouldResolveNullLiteral() {
// Given:
final SqlType type = SqlTypes.STRING;
final Expression exp = new NullLiteral();
// When:
final Object o = new GenericExpressionResolver(type, FIELD_NAME, registry, config, "insert value", false).resolve(exp);
// Then:
assertThat(o, Matchers.nullValue());
}
Aggregations