diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/dataInsight/AggregatedUsedvsUnusedAssetsCountAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/dataInsight/AggregatedUsedvsUnusedAssetsCountAggregator.java index 048a7ce25c91..55da7c43ff35 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/dataInsight/AggregatedUsedvsUnusedAssetsCountAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/dataInsight/AggregatedUsedvsUnusedAssetsCountAggregator.java @@ -26,9 +26,12 @@ public List aggregate() throws ParseException { Double used = Objects.requireNonNullElse(getValue(totalUsed), 0.0); Double unused = Objects.requireNonNullElse(getValue(totalUnused), 0.0); Double total = used + unused; - Double usedPercentage = used / total; - Double unusedPercentage = unused / total; - + Double usedPercentage = 0.0; + Double unusedPercentage = 0.0; + if (total != 0.0) { + usedPercentage = used / total; + unusedPercentage = unused / total; + } data.add( new AggregatedUsedVsUnusedAssetsCount() .withTimestamp(timestamp) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/dataInsight/AggregatedUsedvsUnusedAssetsSizeAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/dataInsight/AggregatedUsedvsUnusedAssetsSizeAggregator.java index 5208caf76ee8..c308befe3d39 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/dataInsight/AggregatedUsedvsUnusedAssetsSizeAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/dataInsight/AggregatedUsedvsUnusedAssetsSizeAggregator.java @@ -25,9 +25,12 @@ public List aggregate() throws ParseException { Double used = Objects.requireNonNullElse(getValue(totalUsed), 0.0); Double unused = Objects.requireNonNullElse(getValue(totalUnused), 0.0); Double total = used + unused; - Double usedPercentage = used / total; - Double unusedPercentage = unused / total; - + Double usedPercentage = 0.0; + Double unusedPercentage = 0.0; + if (total != 0.0) { + usedPercentage = used / total; + unusedPercentage = unused / total; + } data.add( new AggregatedUsedVsUnusedAssetsSize() .withTimestamp(timestamp)