You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2019/07/26 20:00:38 UTC

[GitHub] [incubator-iceberg] rdsr commented on a change in pull request #309: Add mechanism to expire table metadata

rdsr commented on a change in pull request #309: Add mechanism to expire table metadata
URL: https://github.com/apache/incubator-iceberg/pull/309#discussion_r307890410
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/hadoop/HadoopTableOperations.java
 ##########
 @@ -271,4 +309,17 @@ private RuntimeException tryDelete(Path path) {
   protected FileSystem getFileSystem(Path path, Configuration hadoopConf) {
     return Util.getFs(path, hadoopConf);
   }
+
+  private int parseVersion(Path path) {
+    Matcher matcher = METADATA_VERSION_PATTERN.matcher(path.getName());
+    int result = -1;
+    try {
+      if (matcher.find() && matcher.groupCount() == 1) {
+        result = Integer.parseInt(matcher.group(1));
+      }
+    } catch (NumberFormatException e) {
+      LOG.warn("Unable to parse metadata version for: {}", path.toString(), e);
 
 Review comment:
   I think number format exception should never happen since this is written and maintained within internal code, so this should throw and not catch the exception. Catching this could hide actual errors, no?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org