-
Sponsor
Sponsor schemacrawler/SchemaCrawler
- Notifications
- Fork 181
Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Loading status checks…
Use concurrent hashmap for hidden columns
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| return column; | |||
| } | |||
|
|
|||
| private Set<NamedObjectKey> retrieveHiddenTableColumnsLookupKeys() throws SQLException { | |||
|
|
|||
| final Set<NamedObjectKey> hiddenTableColumnsLookupKeys = new HashSet<>(); | |||
| final Set<NamedObjectKey> hiddenTableColumnsLookupKeys = ConcurrentHashMap.newKeySet(); | |||
|
|
|||
| final InformationSchemaViews informationSchemaViews = | |||
| getRetrieverConnection().getInformationSchemaViews(); | |||
| if (!informationSchemaViews.hasQuery(EXT_HIDDEN_TABLE_COLUMNS)) { | |||
| LOGGER.log(Level.INFO, "No hidden table columns SQL provided"); | |||
| return hiddenTableColumnsLookupKeys; | |||
|
|||
|
|||
| } | |||
| final Query hiddenColumnsSql = informationSchemaViews.getQuery(EXT_HIDDEN_TABLE_COLUMNS); | |||
| try (final Connection connection = getRetrieverConnection().getConnection(); | |||
| final Statement statement = connection.createStatement(); | |||
| final MetadataResultSet results = | |||
| new MetadataResultSet(hiddenColumnsSql, statement, getSchemaInclusionRule()); ) { | |||
| while (results.next()) { | |||
| // NOTE: The column names in the extension table are different | |||
| // than the database metadata column names | |||
| final String catalogName = normalizeCatalogName(results.getString("TABLE_CATALOG")); | |||
| final String schemaName = normalizeSchemaName(results.getString("TABLE_SCHEMA")); | |||
| final String tableName = results.getString("TABLE_NAME"); | |||
| final String columnName = results.getString("COLUMN_NAME"); | |||
| LOGGER.log( | |||
| Level.FINE, | |||
| new StringFormat( | |||
| "Retrieving hidden column <%s.%s.%s.%s>", | |||
| catalogName, schemaName, tableName, columnName)); | |||
| final NamedObjectKey lookupKey = | |||
| new NamedObjectKey(catalogName, schemaName, tableName, columnName); | |||
| hiddenTableColumnsLookupKeys.add(lookupKey); | |||
| } | |||
| } | |||
| return hiddenTableColumnsLookupKeys; | |||
| } | |||
| private void retrieveTableColumnsFromDataDictionary( | |||