pvary commented on code in PR #4946:
URL: https://github.com/apache/iceberg/pull/4946#discussion_r895530480
##########
core/src/main/java/org/apache/iceberg/BaseMetastoreTableOperations.java:
##########
@@ -334,6 +334,12 @@ private String newTableMetadataFilePath(TableMetadata
meta, int newVersion) {
private static int parseVersion(String metadataLocation) {
int versionStart = metadataLocation.lastIndexOf('/') + 1; // if '/' isn't
found, this will be 0
int versionEnd = metadataLocation.indexOf('-', versionStart);
+ if (versionEnd < 0) {
+ // As per the spec, metastore tables and filesystem tables
Review Comment:
What about something like this:
```
If there the version is not parseable return -1 as a sign that the metadata
is not part of this catalog
```
Or ever better remove this comment and add a javadoc for this method, since
this is the same behaviour as we handle `NumberFormatExceptions`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]