You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2021/09/27 22:42:13 UTC

[GitHub] [gobblin] vikrambohra commented on a change in pull request #3405: [GOBBLIN-1553] Catch exception when iceberg does not support get metrics for non-optional union type

vikrambohra commented on a change in pull request #3405:
URL: https://github.com/apache/gobblin/pull/3405#discussion_r717093283



##########
File path: gobblin-iceberg/src/main/java/org/apache/gobblin/iceberg/publisher/GobblinMCEPublisher.java
##########
@@ -198,7 +198,12 @@ public static Metrics getMetrics(State state, Path path, Configuration conf, Nam
           //This means the table is not compatible with iceberg, so return a dummy metric
           return new Metrics(100000000L, null, null, null);
         }
-        return OrcMetrics.fromInputFile(HadoopInputFile.fromPath(path, conf), MetricsConfig.getDefault(), mapping);
+        try {
+          return OrcMetrics.fromInputFile(HadoopInputFile.fromPath(path, conf), MetricsConfig.getDefault(), mapping);
+        } catch (Exception e) {
+          //This means the table is not compatible with iceberg, so return a dummy metric
+          return new Metrics(100000000L, null, null, null);

Review comment:
       Can we have a common static instance called DUMMY_METRIC = new Metrics(100000000L, null, null, null); and return in both places




-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org