Skip to content

Commit

Permalink
Don't throw exception in requiresGlobalState (#3960)
Browse files Browse the repository at this point in the history
It's possible that an old storage format hits this code and fails to
upgrade if it uses and old storage format type, thus it's better to
return false rather than throwing an exception
  • Loading branch information
nastra authored Apr 14, 2022
1 parent a5ccf6a commit fc0a6fe
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,8 @@ public boolean requiresGlobalState(Content content) {
// yes, Iceberg Views used global state before, but no longer do so
case DELTA_LAKE_TABLE:
case NAMESPACE:
return false;
default:
throw new IllegalArgumentException("Unknown onRefContent " + content);
return false;
}
}

Expand All @@ -271,11 +270,8 @@ public boolean requiresGlobalState(ByteString content) {
return !parsed.getIcebergRefState().hasMetadataLocation();
case ICEBERG_VIEW_STATE:
return !parsed.getIcebergViewState().hasMetadataLocation();
case DELTA_LAKE_TABLE:
case NAMESPACE:
return false;
default:
throw new IllegalArgumentException("Unsupported on-ref content " + parsed);
return false;
}
}

Expand Down

0 comments on commit fc0a6fe

Please sign in to comment.