use of io.crate.sql.tree.Cast in project crate by crate.
the class DataTypeAnalyzerTest method testCastToNestedArrayExpressionReturnsArrayType.
@Test
public void testCastToNestedArrayExpressionReturnsArrayType() {
Cast cast = (Cast) SqlParser.createExpression("xs::array(array(int))");
DataType<?> dataType = DataTypeAnalyzer.convert(cast.getType());
assertThat(dataType, is(new ArrayType<>(new ArrayType<>(DataTypes.INTEGER))));
}
use of io.crate.sql.tree.Cast in project crate by crate.
the class TestSqlParser method testDataTypesWithWhitespaceCharacters.
@Test
public void testDataTypesWithWhitespaceCharacters() {
Cast cast = (Cast) SqlParser.createExpression("1::double precision");
assertThat(cast.getType().getClass(), is(ColumnType.class));
assertThat(cast.getType().name(), is("double precision"));
}
Aggregations