Skip to content

Commit

Permalink
Remove redundant QualifiedTablePrefix.matches checks
Browse files Browse the repository at this point in the history
The case where table name is present is handled earlier in the method
(`prefix.asQualifiedObjectName().isPresent()` check). The connector is
asked to list entities for given schema (or all entities if schema is
`Optional.empty`), thus subsequent check for `prefix.matches` was
redundant.
  • Loading branch information
findepi committed Aug 10, 2023
1 parent 729e1b4 commit 740f5f9
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ public List<QualifiedObjectName> listTables(Session session, QualifiedTablePrefi
metadata.listTables(connectorSession, prefix.getSchemaName()).stream()
.map(convertFromSchemaTableName(prefix.getCatalogName()))
.filter(table -> !isExternalInformationSchema(catalogHandle, table.getSchemaName()))
.filter(prefix::matches)
.forEach(tables::add);
}
}
Expand Down Expand Up @@ -1186,7 +1185,6 @@ public List<QualifiedObjectName> listViews(Session session, QualifiedTablePrefix
metadata.listViews(connectorSession, prefix.getSchemaName()).stream()
.map(convertFromSchemaTableName(prefix.getCatalogName()))
.filter(view -> !isExternalInformationSchema(catalogHandle, view.getSchemaName()))
.filter(prefix::matches)
.forEach(views::add);
}
}
Expand Down Expand Up @@ -1420,7 +1418,6 @@ public List<QualifiedObjectName> listMaterializedViews(Session session, Qualifie
metadata.listMaterializedViews(connectorSession, prefix.getSchemaName()).stream()
.map(convertFromSchemaTableName(prefix.getCatalogName()))
.filter(materializedView -> !isExternalInformationSchema(catalogHandle, materializedView.getSchemaName()))
.filter(prefix::matches)
.forEach(materializedViews::add);
}
}
Expand Down

0 comments on commit 740f5f9

Please sign in to comment.