Java Code Examples for org.apache.hadoop.hive.metastore.api.SQLPrimaryKey

The following examples show how to use org.apache.hadoop.hive.metastore.api.SQLPrimaryKey. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public void createTableWithConstraints(
    org.apache.hadoop.hive.metastore.api.Table table,
    List<SQLPrimaryKey> primaryKeys,
    List<SQLForeignKey> foreignKeys
) throws AlreadyExistsException, TException {
  throw new UnsupportedOperationException("createTableWithConstraints is not supported");
}
 
Example 2
@Override
public void createTableWithConstraints(
    org.apache.hadoop.hive.metastore.api.Table table,
    List<SQLPrimaryKey> primaryKeys,
    List<SQLForeignKey> foreignKeys
) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException {
  glueMetastoreClientDelegate.createTableWithConstraints(table, primaryKeys, foreignKeys);
}
 
Example 3
Source Project: waggle-dance   Source File: DatabaseMappingImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public PrimaryKeysResponse transformOutboundPrimaryKeysResponse(PrimaryKeysResponse response) {
  for (SQLPrimaryKey key : response.getPrimaryKeys()) {
    key.setTable_db(metaStoreMapping.transformOutboundDatabaseName(key.getTable_db()));
  }
  return response;
}
 
Example 4
Source Project: waggle-dance   Source File: FederatedHMSHandler.java    License: Apache License 2.0 5 votes vote down vote up
@Override
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
public void create_table_with_constraints(Table tbl, List<SQLPrimaryKey> primaryKeys, List<SQLForeignKey> foreignKeys)
    throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException {
  DatabaseMapping mapping = checkWritePermissions(tbl.getDbName());
  mapping.getClient().create_table_with_constraints(mapping.transformInboundTable(tbl), primaryKeys, foreignKeys);
}
 
Example 5
Source Project: waggle-dance   Source File: DatabaseMappingImplTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void transformOutboundPrimaryKeysResponse() throws Exception {
  SQLPrimaryKey primaryKey = new SQLPrimaryKey();
  primaryKey.setTable_db(DB_NAME);
  PrimaryKeysResponse primaryKeysResponse = new PrimaryKeysResponse(Collections.singletonList(primaryKey));
  PrimaryKeysResponse result = databaseMapping.transformOutboundPrimaryKeysResponse(primaryKeysResponse);
  assertThat(result, is(sameInstance(primaryKeysResponse)));
  assertThat(result.getPrimaryKeys().size(), is(1));
  assertThat(result.getPrimaryKeys().get(0), is(sameInstance(primaryKeysResponse.getPrimaryKeys().get(0))));
  assertThat(result.getPrimaryKeys().get(0).getTable_db(), is(OUT_DB_NAME));
}
 
Example 6
Source Project: waggle-dance   Source File: FederatedHMSHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void create_table_with_constraints() throws TException {
  Table table = new Table();
  table.setDbName(DB_P);
  Table inboundTable = new Table();
  List<SQLPrimaryKey> primaryKeys = Collections.emptyList();
  List<SQLForeignKey> foreignKeys = Collections.emptyList();
  when(primaryMapping.transformInboundTable(table)).thenReturn(inboundTable);
  handler.create_table_with_constraints(table, primaryKeys, foreignKeys);
  verify(primaryMapping).checkWritePermissions(DB_P);
  verify(primaryClient).create_table_with_constraints(inboundTable, primaryKeys, foreignKeys);
}
 
Example 7
Source Project: submarine   Source File: SubmarineMetaStore.java    License: Apache License 2.0 4 votes vote down vote up
public void createTableWithConstraints(Table tbl,
                                       List<SQLPrimaryKey> primaryKeys,
                                       List<SQLForeignKey> foreignKeys)
    throws InvalidObjectException, MetaException {
  rs.createTableWithConstraints(tbl, primaryKeys, foreignKeys);
}
 
Example 8
Source Project: submarine   Source File: SubmarineMetaStore.java    License: Apache License 2.0 4 votes vote down vote up
public void addPrimaryKeys(List<SQLPrimaryKey> pks) throws InvalidObjectException, MetaException {
  rs.addPrimaryKeys(pks);
}
 
Example 9
public void addPrimaryKey(List<SQLPrimaryKey> primaryKeyCols) throws TException {
  throw new UnsupportedOperationException("addPrimaryKey is not supported");
}
 
Example 10
@Override
public List<SQLPrimaryKey> getPrimaryKeys(PrimaryKeysRequest primaryKeysRequest) throws MetaException, NoSuchObjectException, TException {
  // PrimaryKeys are currently unsupported
  //return null to allow DESCRIBE (FORMATTED | EXTENDED)
  return null;
}
 
Example 11
@Override
public void addPrimaryKey(List<SQLPrimaryKey> primaryKeyCols)
    throws MetaException, NoSuchObjectException, TException {
  glueMetastoreClientDelegate.addPrimaryKey(primaryKeyCols);
}