use of io.crate.types.ArrayType in project crate by crate.
the class DocIndexMetadataTest method testCreateTableMappingGenerationAndParsingCompat.
@Test
public void testCreateTableMappingGenerationAndParsingCompat() throws Exception {
DocIndexMetadata md = getDocIndexMetadataFromStatement("create table foo (" + "id int primary key," + "tags array(string)," + "o object as (" + " age int," + " name string" + ")," + "date timestamp with time zone primary key" + ") partitioned by (date)");
assertThat(md.columns().size(), is(4));
assertThat(md.primaryKey(), Matchers.contains(new ColumnIdent("id"), new ColumnIdent("date")));
assertThat(md.references().get(new ColumnIdent("tags")).valueType(), is(new ArrayType(DataTypes.STRING)));
}
Aggregations