diff --git a/processing/src/main/java/io/druid/query/aggregation/DoubleSumAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/DoubleSumAggregatorFactory.java index ebd4e185ea3..c7f3eba75f4 100644 --- a/processing/src/main/java/io/druid/query/aggregation/DoubleSumAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/DoubleSumAggregatorFactory.java @@ -88,6 +88,10 @@ public class DoubleSumAggregatorFactory implements AggregatorFactory @Override public Object deserialize(Object object) { + // handle "NaN" / "Infinity" values serialized as strings in JSON + if (object instanceof String) { + return Double.parseDouble((String) object); + } return object; } diff --git a/processing/src/main/java/io/druid/query/aggregation/JavaScriptAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/JavaScriptAggregatorFactory.java index 6de6be09ad8..85bd9597ae8 100644 --- a/processing/src/main/java/io/druid/query/aggregation/JavaScriptAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/JavaScriptAggregatorFactory.java @@ -139,6 +139,10 @@ public class JavaScriptAggregatorFactory implements AggregatorFactory @Override public Object deserialize(Object object) { + // handle "NaN" / "Infinity" values serialized as strings in JSON + if (object instanceof String) { + return Double.parseDouble((String) object); + } return object; } diff --git a/processing/src/main/java/io/druid/query/aggregation/MaxAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/MaxAggregatorFactory.java index ee8217f820b..b731c4319e7 100644 --- a/processing/src/main/java/io/druid/query/aggregation/MaxAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/MaxAggregatorFactory.java @@ -85,6 +85,7 @@ public class MaxAggregatorFactory implements AggregatorFactory @Override public Object deserialize(Object object) { + // handle "NaN" / "Infinity" values serialized as strings in JSON if (object instanceof String) { return Double.parseDouble((String) object); } diff --git a/processing/src/main/java/io/druid/query/aggregation/MinAggregatorFactory.java b/processing/src/main/java/io/druid/query/aggregation/MinAggregatorFactory.java index 9c3d560bacf..d3956c94b52 100644 --- a/processing/src/main/java/io/druid/query/aggregation/MinAggregatorFactory.java +++ b/processing/src/main/java/io/druid/query/aggregation/MinAggregatorFactory.java @@ -85,6 +85,7 @@ public class MinAggregatorFactory implements AggregatorFactory @Override public Object deserialize(Object object) { + // handle "NaN" / "Infinity" values serialized as strings in JSON if (object instanceof String) { return Double.parseDouble((String) object); }