Github user sudheeshkatkam commented on a diff in the pull request:
https://github.com/apache/drill/pull/592#discussion_r84967719
--- Diff:
contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/DrillHiveMetaStoreClient.java
---
@@ -233,6 +236,30 @@ private DrillHiveMetaStoreClient(final HiveConf
hiveConf) throws MetaException {
}
}
+ public static List<Table> getTablesByNamesByBulkLoadHelper(
+ final HiveMetaStoreClient mClient, final List<String> tableNames,
final String schemaName,
+ final int bulkSize) {
+ final int totalTables = tableNames.size();
+ final List<org.apache.hadoop.hive.metastore.api.Table> tables =
Lists.newArrayList();
+
+ // In each round, Drill asks for a sub-list of all the requested tables
+ for (int fromIndex = 0; fromIndex < totalTables; fromIndex +=
bulkSize) {
+ final int toIndex = Math.min(fromIndex + bulkSize, totalTables);
+ final List<String> eachBulkofTableNames =
tableNames.subList(fromIndex, toIndex);
+ List<org.apache.hadoop.hive.metastore.api.Table> eachBulkofTables;
+ // Retries once if the first call to fetch the metadata fails
+ try {
+ eachBulkofTables =
--- End diff --
`eachBulkofTables = getTableObjectsByNameHelper(mClient, schemaName,
eachBulkofTableNames);`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---