vdiravka commented on a change in pull request #1706: DRILL-7115: Improve Hive
schema show tables performance
URL: https://github.com/apache/drill/pull/1706#discussion_r271160776
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/WorkspaceSchemaFactory.java
##########
@@ -920,46 +920,11 @@ public void dropTable(String table) {
}
@Override
- public List<Pair<String, TableType>> getTableNamesAndTypes(boolean
bulkLoad, int bulkSize) {
- final List<Pair<String, TableType>> tableNamesAndTypes =
Lists.newArrayList();
-
- // Look for raw tables first
- if (!tables.isEmpty()) {
- for (Map.Entry<TableInstance, DrillTable> tableEntry :
tables.entrySet()) {
- tableNamesAndTypes
- .add(Pair.of(tableEntry.getKey().sig.name,
tableEntry.getValue().getJdbcTableType()));
- }
- }
- // Then look for files that start with this name and end in .drill.
- List<DotDrillFile> files = Collections.emptyList();
- try {
- files = DotDrillUtil.getDotDrills(getFS(), new
Path(config.getLocation()), DotDrillType.VIEW);
- } catch (AccessControlException e) {
- if (!schemaConfig.getIgnoreAuthErrors()) {
- logger.debug(e.getMessage());
- throw UserException.permissionError(e)
- .message("Not authorized to list or query tables in schema
[%s]", getFullSchemaName())
- .build(logger);
- }
- } catch (IOException e) {
- logger.warn("Failure while trying to list view tables in workspace
[{}]", getFullSchemaName(), e);
- } catch (UnsupportedOperationException e) {
- // the file system (e.g. the classpath filesystem) may not support
listing
- // of files. But see getViews(), it ignores the exception and continues
- logger.debug("Failure while trying to list view tables in workspace
[{}]", getFullSchemaName(), e);
- }
-
- try {
- for (DotDrillFile f : files) {
- if (f.getType() == DotDrillType.VIEW) {
- tableNamesAndTypes.add(Pair.of(f.getBaseName(), TableType.VIEW));
- }
- }
- } catch (UnsupportedOperationException e) {
- logger.debug("The filesystem for this workspace does not support this
operation.", e);
Review comment:
What about logging?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services