use of io.confluent.ksql.execution.expression.tree.Expression in project ksql by confluentinc.
the class ExpressionTreeRewriterTest method shouldRewriteSubscriptExpressionUsingPlugin.
@Test
public void shouldRewriteSubscriptExpressionUsingPlugin() {
// Given:
final Expression parsed = parseExpression("col4[1]");
// When/Then:
shouldRewriteUsingPlugin(parsed);
}
use of io.confluent.ksql.execution.expression.tree.Expression in project ksql by confluentinc.
the class ExpressionTreeRewriterTest method shouldRewriteLikePredicateUsingPlugin.
@Test
public void shouldRewriteLikePredicateUsingPlugin() {
// Given:
final Expression parsed = parseExpression("col1 LIKE '%foo%'");
// When/Then:
shouldRewriteUsingPlugin(parsed);
}
use of io.confluent.ksql.execution.expression.tree.Expression in project ksql by confluentinc.
the class ExpressionTreeRewriterTest method shouldRewriteFunctionCallUsingPlugin.
@Test
public void shouldRewriteFunctionCallUsingPlugin() {
// Given:
final Expression parsed = parseExpression("STRLEN('foo')");
// When/Then:
shouldRewriteUsingPlugin(parsed);
}
use of io.confluent.ksql.execution.expression.tree.Expression in project ksql by confluentinc.
the class ExpressionTreeRewriterTest method shouldRewriteCreateArrayExpression.
@Test
public void shouldRewriteCreateArrayExpression() {
// Given:
final CreateArrayExpression parsed = parseExpression("ARRAY['foo', col4[1]]");
final Expression firstVal = parsed.getValues().get(0);
final Expression secondVal = parsed.getValues().get(1);
when(processor.apply(firstVal, context)).thenReturn(expr1);
when(processor.apply(secondVal, context)).thenReturn(expr2);
// When:
final Expression rewritten = expressionRewriter.rewrite(parsed, context);
// Then:
assertThat(rewritten, equalTo(new CreateArrayExpression(ImmutableList.of(expr1, expr2))));
}
use of io.confluent.ksql.execution.expression.tree.Expression in project ksql by confluentinc.
the class ExpressionTreeRewriterTest method shouldRewriteLogicalBinaryExpressionUsingPlugin.
@Test
public void shouldRewriteLogicalBinaryExpressionUsingPlugin() {
// Given:
final Expression parsed = parseExpression("true OR false");
// When/Then:
shouldRewriteUsingPlugin(parsed);
}
Aggregations