Skip to content

Commit

Permalink
#2363 add size parameter for StageDB's table list
Browse files Browse the repository at this point in the history
  • Loading branch information
ufoscw authored and alchan-lee committed Jul 23, 2019
1 parent 6362539 commit 7bf45c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class DataconnectionService extends AbstractService {
const params = {
database: databaseName
};
return this.post(this.API_URL + 'connections/query/hive/tables', params)
return this.post(this.API_URL + 'connections/query/hive/tables?size=5000', params)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,17 @@ public Map<String, Object> getTables(String catalog,
Integer pageNumber) {
HiveMetaStoreJdbcClient hiveMetaStoreJdbcClient = this.getHiveMetaStoreJdbcClient();

if(pageSize == null){
pageSize = 5000;
}

if(pageNumber == null){
pageNumber = 0;
}

List<Map<String, Object>> tableNames
= hiveMetaStoreJdbcClient.getTable(schemaPattern, tableNamePattern, null, pageSize, pageNumber);
Integer tableCount = hiveMetaStoreJdbcClient.getTableCount(schemaPattern, tableNamePattern, null);

//exclude table
List<String> excludeTables = getExcludeTables();
Expand All @@ -73,7 +82,7 @@ public Map<String, Object> getTables(String catalog,

Map<String, Object> databaseMap = new LinkedHashMap<>();
databaseMap.put("tables", tableNames);
databaseMap.put("page", createPageInfoMap(tableNames.size(), tableNames.size(), 0));
databaseMap.put("page", createPageInfoMap(pageSize, tableCount, pageNumber));
return databaseMap;
}

Expand Down

0 comments on commit 7bf45c2

Please sign in to comment.