[fix](iceberg) iceberg hms support hive1 (#30985)

This commit is contained in:
wangtao
2024-02-18 15:27:32 +08:00
committed by yiguolei
parent 6e4f76de54
commit a7037df9a1

View File

@ -1819,12 +1819,19 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable {
@Override
public List<Table> getTableObjectsByName(String catName, String dbName,
List<String> tableNames) throws TException {
GetTablesRequest req = new GetTablesRequest(dbName);
req.setCatName(catName);
req.setTblNames(tableNames);
req.setCapabilities(version);
List<Table> tabs = client.get_table_objects_by_name_req(req).getTables();
return deepCopyTables(filterHook.filterTables(tabs));
List<Table> tabs = new ArrayList<>();
if (hiveVersion == HiveVersion.V1_0 || hiveVersion == HiveVersion.V2_0) {
for (String tableName: tableNames) {
tabs.add(client.get_table(dbName, tableName));
}
} else {
GetTablesRequest req = new GetTablesRequest(dbName);
req.setCatName(catName);
req.setTblNames(tableNames);
req.setCapabilities(version);
tabs = client.get_table_objects_by_name_req(req).getTables();
}
return deepCopyTables(filterHook.filterTables(tabs));
}
@Override