use of io.confluent.ksql.execution.expression.tree.Type in project ksql by confluentinc.
the class SqlTypeParserTest method shouldGetTypeFromDecimal.
@Test
public void shouldGetTypeFromDecimal() {
// Given:
final String schemaString = "DECIMAL(2, 1)";
// When:
final Type type = parser.parse(schemaString);
// Then:
assertThat(type, is(new Type(SqlTypes.decimal(2, 1))));
}
use of io.confluent.ksql.execution.expression.tree.Type in project ksql by confluentinc.
the class SqlTypeParserTest method shouldGetTypeFromStruct.
@Test
public void shouldGetTypeFromStruct() {
// Given:
final String schemaString = "STRUCT<A VARCHAR>";
// When:
final Type type = parser.parse(schemaString);
// Then:
assertThat(type, is(new Type(SqlTypes.struct().field("A", SqlTypes.STRING).build())));
}
use of io.confluent.ksql.execution.expression.tree.Type in project ksql by confluentinc.
the class SqlTypeParserTest method shouldGetTypeFromStringArray.
@Test
public void shouldGetTypeFromStringArray() {
// Given:
final String schemaString = "ARRAY<VARCHAR>";
// When:
final Type type = parser.parse(schemaString);
// Then:
assertThat(type, is(new Type(SqlTypes.array(SqlTypes.STRING))));
}
use of io.confluent.ksql.execution.expression.tree.Type in project ksql by confluentinc.
the class SqlTypeParserTest method shouldGetTypeFromVarchar.
@Test
public void shouldGetTypeFromVarchar() {
// Given:
final String schemaString = "VARCHAR";
// When:
final Type type = parser.parse(schemaString);
// Then:
assertThat(type, is(new Type(SqlTypes.STRING)));
}
use of io.confluent.ksql.execution.expression.tree.Type in project ksql by confluentinc.
the class SqlTypeParserTest method shouldGetTypeFromMap.
@Test
public void shouldGetTypeFromMap() {
// Given:
final String schemaString = "MAP<BIGINT, INT>";
// When:
final Type type = parser.parse(schemaString);
// Then:
assertThat(type, is(new Type(SqlTypes.map(SqlTypes.BIGINT, SqlTypes.INTEGER))));
}
Aggregations