Search in sources :

Example 71 with Type

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

the class TableElementTest method shouldReturnName.

@Test
public void shouldReturnName() {
    // Given:
    final TableElement element = new TableElement(NAME, new Type(SqlTypes.STRING), NO_COLUMN_CONSTRAINTS);
    // Then:
    assertThat(element.getName(), is(NAME));
}
Also used : Type(io.confluent.ksql.execution.expression.tree.Type) Test(org.junit.Test)

Example 72 with Type

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

the class TableElementTest method shouldReturnHeadersConstraint.

@Test
public void shouldReturnHeadersConstraint() {
    // Given:
    final TableElement valueElement = new TableElement(NAME, new Type(SqlTypes.STRING), HEADERS_CONSTRAINT);
    // Then:
    assertThat(valueElement.getConstraints(), is(HEADERS_CONSTRAINT));
}
Also used : Type(io.confluent.ksql.execution.expression.tree.Type) Test(org.junit.Test)

Example 73 with Type

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

the class TableElementTest method shouldReturnEmptyConstraints.

@Test
public void shouldReturnEmptyConstraints() {
    // Given:
    final TableElement valueElement = new TableElement(NAME, new Type(SqlTypes.STRING));
    // Then:
    assertThat(valueElement.getConstraints(), is(NO_COLUMN_CONSTRAINTS));
}
Also used : Type(io.confluent.ksql.execution.expression.tree.Type) Test(org.junit.Test)

Aggregations

Type (io.confluent.ksql.execution.expression.tree.Type)73 Test (org.junit.Test)71 SqlPrimitiveType (io.confluent.ksql.schema.ksql.types.SqlPrimitiveType)23 DataSourceType (io.confluent.ksql.metastore.model.DataSource.DataSourceType)19 Matchers.containsString (org.hamcrest.Matchers.containsString)16 Cast (io.confluent.ksql.execution.expression.tree.Cast)13 CreateStream (io.confluent.ksql.parser.tree.CreateStream)13 ArithmeticBinaryExpression (io.confluent.ksql.execution.expression.tree.ArithmeticBinaryExpression)12 ArithmeticUnaryExpression (io.confluent.ksql.execution.expression.tree.ArithmeticUnaryExpression)12 ComparisonExpression (io.confluent.ksql.execution.expression.tree.ComparisonExpression)12 CreateArrayExpression (io.confluent.ksql.execution.expression.tree.CreateArrayExpression)12 CreateMapExpression (io.confluent.ksql.execution.expression.tree.CreateMapExpression)12 CreateStructExpression (io.confluent.ksql.execution.expression.tree.CreateStructExpression)12 DereferenceExpression (io.confluent.ksql.execution.expression.tree.DereferenceExpression)12 Expression (io.confluent.ksql.execution.expression.tree.Expression)12 InListExpression (io.confluent.ksql.execution.expression.tree.InListExpression)12 LogicalBinaryExpression (io.confluent.ksql.execution.expression.tree.LogicalBinaryExpression)12 SearchedCaseExpression (io.confluent.ksql.execution.expression.tree.SearchedCaseExpression)12 StringLiteral (io.confluent.ksql.execution.expression.tree.StringLiteral)12 SubscriptExpression (io.confluent.ksql.execution.expression.tree.SubscriptExpression)12