Search in sources :

Example 16 with QualifiedColumnReferenceExp

use of io.confluent.ksql.execution.expression.tree.QualifiedColumnReferenceExp in project ksql by confluentinc.

the class AggregateAnalyzerTest method shouldThrowOnQualifiedColumnReference.

@Test
public void shouldThrowOnQualifiedColumnReference() {
    // Given:
    givenSelectExpression(new QualifiedColumnReferenceExp(SourceName.of("Fred"), SystemColumns.WINDOWEND_NAME));
    // When:
    assertThrows(UnsupportedOperationException.class, () -> analyzer.analyze(analysis, selects));
}
Also used : QualifiedColumnReferenceExp(io.confluent.ksql.execution.expression.tree.QualifiedColumnReferenceExp) Test(org.junit.Test)

Example 17 with QualifiedColumnReferenceExp

use of io.confluent.ksql.execution.expression.tree.QualifiedColumnReferenceExp in project ksql by confluentinc.

the class ExpressionTreeRewriterTest method shouldRewriteQualifiedColumnReferenceUsingPlugin.

@Test
public void shouldRewriteQualifiedColumnReferenceUsingPlugin() {
    // Given:
    final QualifiedColumnReferenceExp expression = new QualifiedColumnReferenceExp(SourceName.of("bar"), ColumnName.of("foo"));
    // When/Then:
    shouldRewriteUsingPlugin(expression);
}
Also used : QualifiedColumnReferenceExp(io.confluent.ksql.execution.expression.tree.QualifiedColumnReferenceExp) Test(org.junit.Test)

Example 18 with QualifiedColumnReferenceExp

use of io.confluent.ksql.execution.expression.tree.QualifiedColumnReferenceExp in project ksql by confluentinc.

the class ExpressionTreeRewriterTest method shouldRewriteQualifiedColumnReference.

@Test
public void shouldRewriteQualifiedColumnReference() {
    // Given:
    final QualifiedColumnReferenceExp expression = new QualifiedColumnReferenceExp(SourceName.of("bar"), ColumnName.of("foo"));
    // When:
    final Expression rewritten = expressionRewriter.rewrite(expression, context);
    // Then:
    assertThat(rewritten, is(expression));
}
Also used : ArithmeticBinaryExpression(io.confluent.ksql.execution.expression.tree.ArithmeticBinaryExpression) LogicalBinaryExpression(io.confluent.ksql.execution.expression.tree.LogicalBinaryExpression) Expression(io.confluent.ksql.execution.expression.tree.Expression) CreateMapExpression(io.confluent.ksql.execution.expression.tree.CreateMapExpression) DereferenceExpression(io.confluent.ksql.execution.expression.tree.DereferenceExpression) ArithmeticUnaryExpression(io.confluent.ksql.execution.expression.tree.ArithmeticUnaryExpression) CreateArrayExpression(io.confluent.ksql.execution.expression.tree.CreateArrayExpression) CreateStructExpression(io.confluent.ksql.execution.expression.tree.CreateStructExpression) NotExpression(io.confluent.ksql.execution.expression.tree.NotExpression) SimpleCaseExpression(io.confluent.ksql.execution.expression.tree.SimpleCaseExpression) SubscriptExpression(io.confluent.ksql.execution.expression.tree.SubscriptExpression) InListExpression(io.confluent.ksql.execution.expression.tree.InListExpression) ComparisonExpression(io.confluent.ksql.execution.expression.tree.ComparisonExpression) SearchedCaseExpression(io.confluent.ksql.execution.expression.tree.SearchedCaseExpression) QualifiedColumnReferenceExp(io.confluent.ksql.execution.expression.tree.QualifiedColumnReferenceExp) Test(org.junit.Test)

Aggregations

QualifiedColumnReferenceExp (io.confluent.ksql.execution.expression.tree.QualifiedColumnReferenceExp)18 Test (org.junit.Test)13 Expression (io.confluent.ksql.execution.expression.tree.Expression)9 UnqualifiedColumnReferenceExp (io.confluent.ksql.execution.expression.tree.UnqualifiedColumnReferenceExp)6 Context (io.confluent.ksql.engine.rewrite.ExpressionTreeRewriter.Context)4 ColumnName (io.confluent.ksql.name.ColumnName)4 SingleColumn (io.confluent.ksql.parser.tree.SingleColumn)4 Optional (java.util.Optional)4 VisitParentExpressionVisitor (io.confluent.ksql.execution.expression.tree.VisitParentExpressionVisitor)3 SelectExpression (io.confluent.ksql.execution.plan.SelectExpression)3 KsqlWindowExpression (io.confluent.ksql.execution.windows.KsqlWindowExpression)3 SourceName (io.confluent.ksql.name.SourceName)3 WindowExpression (io.confluent.ksql.parser.tree.WindowExpression)3 KsqlException (io.confluent.ksql.util.KsqlException)3 ExpressionTreeRewriter (io.confluent.ksql.engine.rewrite.ExpressionTreeRewriter)2 CodeGenRunner (io.confluent.ksql.execution.codegen.CodeGenRunner)2 KsqlTopic (io.confluent.ksql.execution.ddl.commands.KsqlTopic)2 ArithmeticBinaryExpression (io.confluent.ksql.execution.expression.tree.ArithmeticBinaryExpression)2 ColumnReferenceExp (io.confluent.ksql.execution.expression.tree.ColumnReferenceExp)2 ComparisonExpression (io.confluent.ksql.execution.expression.tree.ComparisonExpression)2