org.apache.hadoop.hive.metastore.api.UnknownDBException Java Examples
The following examples show how to use
org.apache.hadoop.hive.metastore.api.UnknownDBException.
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: HiveShimV1.java From flink with Apache License 2.0 | 6 votes |
@Override // 1.x client doesn't support filtering tables by type, so here we need to get all tables and filter by ourselves public List<String> getViews(IMetaStoreClient client, String databaseName) throws UnknownDBException, TException { // We don't have to use reflection here because client.getAllTables(String) is supposed to be there for // all versions. List<String> tableNames = client.getAllTables(databaseName); List<String> views = new ArrayList<>(); for (String name : tableNames) { Table table = client.getTable(databaseName, name); String viewDef = table.getViewOriginalText(); if (viewDef != null && !viewDef.isEmpty()) { views.add(table.getTableName()); } } return views; }
Example #2
Source File: HiveShimV230.java From flink with Apache License 2.0 | 6 votes |
@Override public List<String> getViews(IMetaStoreClient client, String databaseName) throws UnknownDBException, TException { try { Method method = client.getClass().getMethod("getTables", String.class, String.class, TableType.class); return (List<String>) method.invoke(client, databaseName, null, TableType.VIRTUAL_VIEW); } catch (InvocationTargetException ite) { Throwable targetEx = ite.getTargetException(); if (targetEx instanceof TException) { throw (TException) targetEx; } else { throw new CatalogException(String.format("Failed to get views for %s", databaseName), targetEx); } } catch (NoSuchMethodException | IllegalAccessException e) { throw new CatalogException(String.format("Failed to get views for %s", databaseName), e); } }
Example #3
Source File: HiveShimV100.java From flink with Apache License 2.0 | 6 votes |
@Override // 1.x client doesn't support filtering tables by type, so here we need to get all tables and filter by ourselves public List<String> getViews(IMetaStoreClient client, String databaseName) throws UnknownDBException, TException { // We don't have to use reflection here because client.getAllTables(String) is supposed to be there for // all versions. List<String> tableNames = client.getAllTables(databaseName); List<String> views = new ArrayList<>(); for (String name : tableNames) { Table table = client.getTable(databaseName, name); String viewDef = table.getViewOriginalText(); if (viewDef != null && !viewDef.isEmpty()) { views.add(table.getTableName()); } } return views; }
Example #4
Source File: HiveShimV2.java From flink with Apache License 2.0 | 6 votes |
@Override public List<String> getViews(IMetaStoreClient client, String databaseName) throws UnknownDBException, TException { try { Method method = client.getClass().getMethod("getTables", String.class, String.class, TableType.class); return (List<String>) method.invoke(client, databaseName, null, TableType.VIRTUAL_VIEW); } catch (InvocationTargetException ite) { Throwable targetEx = ite.getTargetException(); if (targetEx instanceof TException) { throw (TException) targetEx; } else { throw new CatalogException(String.format("Failed to get views for %s", databaseName), targetEx); } } catch (NoSuchMethodException | IllegalAccessException e) { throw new CatalogException(String.format("Failed to get views for %s", databaseName), e); } }
Example #5
Source File: FederatedHMSHandler.java From waggle-dance with Apache License 2.0 | 5 votes |
@Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public GetTablesResult get_table_objects_by_name_req(GetTablesRequest req) throws MetaException, InvalidOperationException, UnknownDBException, TException { DatabaseMapping mapping = databaseMappingService.databaseMapping(req.getDbName()); GetTablesResult result = mapping .getClient() .get_table_objects_by_name_req(mapping.transformInboundGetTablesRequest(req)); return mapping.transformOutboundGetTablesResult(result); }
Example #6
Source File: FederatedHMSHandler.java From waggle-dance with Apache License 2.0 | 5 votes |
@Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<FieldSchema> get_fields(String db_name, String table_name) throws MetaException, UnknownTableException, UnknownDBException, TException { DatabaseMapping mapping = databaseMappingService.databaseMapping(db_name); return mapping.getClient().get_fields(mapping.transformInboundDatabaseName(db_name), table_name); }
Example #7
Source File: FederatedHMSHandler.java From waggle-dance with Apache License 2.0 | 5 votes |
@Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<FieldSchema> get_schema(String db_name, String table_name) throws MetaException, UnknownTableException, UnknownDBException, TException { DatabaseMapping mapping = databaseMappingService.databaseMapping(db_name); return mapping.getClient().get_schema(mapping.transformInboundDatabaseName(db_name), table_name); }
Example #8
Source File: FederatedHMSHandler.java From waggle-dance with Apache License 2.0 | 5 votes |
@Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<Table> get_table_objects_by_name(String dbname, List<String> tbl_names) throws MetaException, InvalidOperationException, UnknownDBException, TException { DatabaseMapping mapping = databaseMappingService.databaseMapping(dbname); List<Table> tables = mapping .getClient() .get_table_objects_by_name(mapping.transformInboundDatabaseName(dbname), tbl_names); List<Table> outboundTables = new ArrayList<>(tables.size()); for (Table table : tables) { outboundTables.add(mapping.transformOutboundTable(table)); } return outboundTables; }
Example #9
Source File: AWSCatalogMetastoreClient.java From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 | 5 votes |
@Override public List<org.apache.hadoop.hive.metastore.api.Table> getTableObjectsByName(String dbName, List<String> tableNames) throws MetaException, InvalidOperationException, UnknownDBException, TException { List<org.apache.hadoop.hive.metastore.api.Table> hiveTables = Lists.newArrayList(); for(String tableName : tableNames) { hiveTables.add(getTable(dbName, tableName)); } return hiveTables; }
Example #10
Source File: FederatedHMSHandler.java From waggle-dance with Apache License 2.0 | 5 votes |
@Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> get_table_names_by_filter(String dbname, String filter, short max_tables) throws MetaException, InvalidOperationException, UnknownDBException, TException { DatabaseMapping mapping = databaseMappingService.databaseMapping(dbname); return mapping .getClient() .get_table_names_by_filter(mapping.transformInboundDatabaseName(dbname), filter, max_tables); }
Example #11
Source File: FederatedHMSHandler.java From waggle-dance with Apache License 2.0 | 5 votes |
@Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void markPartitionForEvent( String db_name, String tbl_name, Map<String, String> part_vals, PartitionEventType eventType) throws MetaException, NoSuchObjectException, UnknownDBException, UnknownTableException, UnknownPartitionException, InvalidPartitionException, TException { DatabaseMapping mapping = checkWritePermissions(db_name); mapping .getClient() .markPartitionForEvent(mapping.transformInboundDatabaseName(db_name), tbl_name, part_vals, eventType); }
Example #12
Source File: FederatedHMSHandler.java From waggle-dance with Apache License 2.0 | 5 votes |
@Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean isPartitionMarkedForEvent( String db_name, String tbl_name, Map<String, String> part_vals, PartitionEventType eventType) throws MetaException, NoSuchObjectException, UnknownDBException, UnknownTableException, UnknownPartitionException, InvalidPartitionException, TException { DatabaseMapping mapping = databaseMappingService.databaseMapping(db_name); return mapping .getClient() .isPartitionMarkedForEvent(mapping.transformInboundDatabaseName(db_name), tbl_name, part_vals, eventType); }
Example #13
Source File: FederatedHMSHandler.java From waggle-dance with Apache License 2.0 | 5 votes |
@Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<FieldSchema> get_fields_with_environment_context( String db_name, String table_name, EnvironmentContext environment_context) throws MetaException, UnknownTableException, UnknownDBException, TException { DatabaseMapping mapping = databaseMappingService.databaseMapping(db_name); return mapping .getClient() .get_fields_with_environment_context(mapping.transformInboundDatabaseName(db_name), table_name, environment_context); }
Example #14
Source File: FederatedHMSHandler.java From waggle-dance with Apache License 2.0 | 5 votes |
@Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<FieldSchema> get_schema_with_environment_context( String db_name, String table_name, EnvironmentContext environment_context) throws MetaException, UnknownTableException, UnknownDBException, TException { DatabaseMapping mapping = databaseMappingService.databaseMapping(db_name); return mapping .getClient() .get_schema_with_environment_context(mapping.transformInboundDatabaseName(db_name), table_name, environment_context); }
Example #15
Source File: MetastoreClientTableIntegrationTest.java From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 | 5 votes |
@Test (expected = UnknownDBException.class) public void alterTableInvalidDB() throws Exception { String newType = "newType"; Table newHiveTable = CatalogToHiveConverter.convertTable(getTestTable(), hiveTable.getDbName()); newHiveTable.setTableName(hiveTable.getTableName()); newHiveTable.setTableType(newType); metastoreClient.createTable(hiveTable); metastoreClient.alter_table(invalidDatabase, hiveTable.getTableName(), newHiveTable); }
Example #16
Source File: AWSCatalogMetastoreClient.java From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 | 5 votes |
@Override public void markPartitionForEvent( String dbName, String tblName, Map<String, String> partKVs, PartitionEventType eventType ) throws MetaException, NoSuchObjectException, TException, UnknownTableException, UnknownDBException, UnknownPartitionException, InvalidPartitionException { glueMetastoreClientDelegate.markPartitionForEvent(dbName, tblName, partKVs, eventType); }
Example #17
Source File: AWSCatalogMetastoreClient.java From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 | 5 votes |
@Override public void markPartitionForEvent( String dbName, String tblName, Map<String, String> partKVs, PartitionEventType eventType ) throws MetaException, NoSuchObjectException, TException, UnknownTableException, UnknownDBException, UnknownPartitionException, InvalidPartitionException { glueMetastoreClientDelegate.markPartitionForEvent(dbName, tblName, partKVs, eventType); }
Example #18
Source File: SentryHiveMetaStoreClient.java From incubator-sentry with Apache License 2.0 | 5 votes |
@Override public List<String> listTableNamesByFilter(String dbName, String filter, short maxTables) throws InvalidOperationException, UnknownDBException, TException { return filterTables(dbName, super.listTableNamesByFilter(dbName, filter, maxTables)); }
Example #19
Source File: AWSCatalogMetastoreClient.java From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 | 5 votes |
@Override public List<org.apache.hadoop.hive.metastore.api.Table> getTableObjectsByName(String dbName, List<String> tableNames) throws MetaException, InvalidOperationException, UnknownDBException, TException { List<org.apache.hadoop.hive.metastore.api.Table> hiveTables = Lists.newArrayList(); for(String tableName : tableNames) { hiveTables.add(getTable(dbName, tableName)); } return hiveTables; }
Example #20
Source File: HiveMetastoreClientWrapper.java From flink with Apache License 2.0 | 4 votes |
public List<String> getViews(String databaseName) throws UnknownDBException, TException { HiveShim hiveShim = HiveShimLoader.loadHiveShim(hiveVersion); return hiveShim.getViews(client, databaseName); }
Example #21
Source File: HiveThriftMetaStoreIfaceCompatibility.java From waggle-dance with Apache License 2.0 | 4 votes |
GetTablesResult get_table_objects_by_name_req(GetTablesRequest req) throws MetaException, InvalidOperationException, UnknownDBException, TException;
Example #22
Source File: AWSCatalogMetastoreClient.java From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 | 4 votes |
@Override public boolean tableExists(String databaseName, String tableName) throws MetaException, TException, UnknownDBException { return glueMetastoreClientDelegate.tableExists(databaseName, tableName); }
Example #23
Source File: HiveThriftMetaStoreIfaceCompatibility1xx.java From waggle-dance with Apache License 2.0 | 4 votes |
@Override public GetTablesResult get_table_objects_by_name_req(GetTablesRequest req) throws MetaException, InvalidOperationException, UnknownDBException, TException { List<Table> tables = client.get_table_objects_by_name(req.getDbName(), req.getTblNames()); return new GetTablesResult(tables); }
Example #24
Source File: HiveMetastoreClientWrapper.java From flink with Apache License 2.0 | 4 votes |
public List<String> getAllTables(String databaseName) throws MetaException, TException, UnknownDBException { return client.getAllTables(databaseName); }
Example #25
Source File: HiveMetastoreClientWrapper.java From flink with Apache License 2.0 | 4 votes |
public boolean tableExists(String databaseName, String tableName) throws MetaException, TException, UnknownDBException { return client.tableExists(databaseName, tableName); }
Example #26
Source File: HiveMetastoreClientWrapper.java From flink with Apache License 2.0 | 4 votes |
public List<String> getViews(String databaseName) throws UnknownDBException, TException { return hiveShim.getViews(client, databaseName); }
Example #27
Source File: AuthorizingObjectStore.java From incubator-sentry with Apache License 2.0 | 4 votes |
@Override public List<Table> getTableObjectsByName(String dbname, List<String> tableNames) throws MetaException, UnknownDBException { return super.getTableObjectsByName(dbname, filterTables(dbname, tableNames)); }
Example #28
Source File: AuthorizingObjectStoreV2.java From incubator-sentry with Apache License 2.0 | 4 votes |
@Override public List<Table> getTableObjectsByName(String dbname, List<String> tableNames) throws MetaException, UnknownDBException { return super.getTableObjectsByName(dbname, filterTables(dbname, tableNames)); }
Example #29
Source File: AWSCatalogMetastoreClient.java From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 | 4 votes |
@Override public List<String> getAllTables(String dbname) throws MetaException, TException, UnknownDBException { return getTables(dbname, ".*"); }
Example #30
Source File: AWSCatalogMetastoreClient.java From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 | 4 votes |
@Override public List<FieldSchema> getFields(String db, String tableName) throws MetaException, TException, UnknownTableException, UnknownDBException { return glueMetastoreClientDelegate.getFields(db, tableName); }