use of org.apache.hadoop.hive.metastore.client.builder.ISchemaBuilder in project hive by apache.
the class TestHiveMetaStoreSchemaMethods method addDuplicateSchemaVersion.
@Test(expected = AlreadyExistsException.class)
public void addDuplicateSchemaVersion() throws TException {
String schemaName = uniqueSchemaName();
int version = 1;
ISchema schema = new ISchemaBuilder().setSchemaType(SchemaType.AVRO).setName(schemaName).build();
client.createISchema(schema);
SchemaVersion schemaVersion = new SchemaVersionBuilder().versionOf(schema).setVersion(version).addCol("a", ColumnType.INT_TYPE_NAME).addCol("b", ColumnType.FLOAT_TYPE_NAME).build();
client.addSchemaVersion(schemaVersion);
client.addSchemaVersion(schemaVersion);
}
use of org.apache.hadoop.hive.metastore.client.builder.ISchemaBuilder in project hive by apache.
the class TestHiveMetaStoreSchemaMethods method schemaVersionBogusCatalog.
@Test(expected = NoSuchObjectException.class)
public void schemaVersionBogusCatalog() throws TException {
String schemaName = uniqueSchemaName();
ISchema schema = new ISchemaBuilder().setSchemaType(SchemaType.AVRO).setName(schemaName).build();
client.createISchema(schema);
client.getSchemaVersion("bogus", DEFAULT_DATABASE_NAME, schemaName, 1);
}
use of org.apache.hadoop.hive.metastore.client.builder.ISchemaBuilder in project hive by apache.
the class TestHiveMetaStoreSchemaMethods method schemaAlreadyExists.
@Test(expected = AlreadyExistsException.class)
public void schemaAlreadyExists() throws TException {
String schemaName = uniqueSchemaName();
ISchema schema = new ISchemaBuilder().setSchemaType(SchemaType.HIVE).setName(schemaName).build();
client.createISchema(schema);
Assert.assertNotNull(schema);
Assert.assertEquals(SchemaType.HIVE, schema.getSchemaType());
Assert.assertEquals(schemaName, schema.getName());
Assert.assertEquals(SchemaCompatibility.BACKWARD, schema.getCompatibility());
Assert.assertEquals(SchemaValidation.ALL, schema.getValidationLevel());
Assert.assertTrue(schema.isCanEvolve());
// This second attempt to create it should throw
client.createISchema(schema);
}
use of org.apache.hadoop.hive.metastore.client.builder.ISchemaBuilder in project hive by apache.
the class TestHiveMetaStoreSchemaMethods method allSchemaVersionBogusCatalog.
@Test(expected = NoSuchObjectException.class)
public void allSchemaVersionBogusCatalog() throws TException {
String schemaName = uniqueSchemaName();
ISchema schema = new ISchemaBuilder().setSchemaType(SchemaType.AVRO).setName(schemaName).build();
client.createISchema(schema);
client.getSchemaAllVersions("bogus", DEFAULT_DATABASE_NAME, schemaName);
}
use of org.apache.hadoop.hive.metastore.client.builder.ISchemaBuilder in project hive by apache.
the class TestHiveMetaStoreSchemaMethods method allSchemaVersionBogusDb.
@Test(expected = NoSuchObjectException.class)
public void allSchemaVersionBogusDb() throws TException {
String schemaName = uniqueSchemaName();
ISchema schema = new ISchemaBuilder().setSchemaType(SchemaType.AVRO).setName(schemaName).build();
client.createISchema(schema);
client.getSchemaAllVersions(DEFAULT_CATALOG_NAME, "bogus", schemaName);
}
Aggregations