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

The following examples show how to use org.apache.hadoop.hive.metastore.api.SQLPrimaryKey. 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
Source File: GlueMetastoreClientDelegate.java    From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 5 votes vote down vote up
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
Source File: AWSCatalogMetastoreClient.java    From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 5 votes vote down vote up
@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 File: DatabaseMappingImpl.java    From waggle-dance with 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 File: FederatedHMSHandler.java    From waggle-dance with 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 File: DatabaseMappingImplTest.java    From waggle-dance with 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 File: FederatedHMSHandlerTest.java    From waggle-dance with 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 File: SubmarineMetaStore.java    From submarine with 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 File: SubmarineMetaStore.java    From submarine with Apache License 2.0 4 votes vote down vote up
public void addPrimaryKeys(List<SQLPrimaryKey> pks) throws InvalidObjectException, MetaException {
  rs.addPrimaryKeys(pks);
}
 
Example #9
Source File: GlueMetastoreClientDelegate.java    From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 4 votes vote down vote up
public void addPrimaryKey(List<SQLPrimaryKey> primaryKeyCols) throws TException {
  throw new UnsupportedOperationException("addPrimaryKey is not supported");
}
 
Example #10
Source File: AWSCatalogMetastoreClient.java    From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 4 votes vote down vote up
@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
Source File: AWSCatalogMetastoreClient.java    From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 4 votes vote down vote up
@Override
public void addPrimaryKey(List<SQLPrimaryKey> primaryKeyCols)
    throws MetaException, NoSuchObjectException, TException {
  glueMetastoreClientDelegate.addPrimaryKey(primaryKeyCols);
}