Skip to content
Permalink
Browse files
Use concurrent hashmap for hidden columns
sualeh committed Aug 31, 2022
1 parent e63a083 commit f950519
Showing 1 changed file with 2 additions and 2 deletions.
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;

COLLECTOR-SAHAB / differentiating test: SchemaCrawlerUtilityTest

{return-object}.PRESENT = java.lang.Object only occurs in the original version.

{return-object}.map.counterCells = null only occurs in the patched version.

COLLECTOR-SAHAB / differentiating test: SchemaCrawlerUtilityTest

hiddenTableColumnsLookupKeys.MAX_ARRAY_SIZE = 2147483639 only occurs in the original version.

hiddenTableColumnsLookupKeys.value = true only occurs in the patched version.

}
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(

0 comments on commit f950519

Please sign in to comment.