Skip to content

Commit ea06138

Browse files
BryanCutlerPresto CUDF CI
authored andcommitted
Fix NPE in IcebergHiveMetadata.getViews when the provided schema is null
1 parent cafa797 commit ea06138

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergHiveMetadata.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,8 @@ public Map<SchemaTableName, ConnectorViewDefinition> getViews(ConnectorSession s
475475
tableNames = ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName()));
476476
}
477477
else {
478-
tableNames = listViews(session, Optional.of(prefix.getSchemaName()));
478+
tableNames = listViews(session, Optional.ofNullable(prefix.getSchemaName()));
479479
}
480-
MetastoreContext metastoreContext = getMetastoreContext(session);
481480
for (SchemaTableName schemaTableName : tableNames) {
482481
Optional<Table> table = getHiveTable(session, schemaTableName);
483482
if (table.isPresent() && isPrestoView(table.get())) {

0 commit comments

Comments
 (0)