abhishekagarwal87 commented on code in PR #13704:
URL: https://github.com/apache/druid/pull/13704#discussion_r1086528987


##########
processing/src/test/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregatorTest.java:
##########
@@ -183,7 +183,36 @@ public void testQuotient()
     Assert.assertEquals(Double.POSITIVE_INFINITY, 
agg.compute(ImmutableMap.of("value", 1)));
     Assert.assertEquals(Double.NEGATIVE_INFINITY, 
agg.compute(ImmutableMap.of("value", -1)));
   }
+  @Test
+  public void testPow()
+  {
+    ArithmeticPostAggregator agg = new ArithmeticPostAggregator(
+            null,
+            "pow",
+            ImmutableList.of(
+                    new ConstantPostAggregator("value", 4),
+                    new ConstantPostAggregator("power", .5)
+            ),
+            "numericFirst"
+    );
+    Assert.assertEquals(2.0, agg.compute(ImmutableMap.of("value", 0)));
 
+    agg = new ArithmeticPostAggregator(
+            null,
+            "pow",
+            ImmutableList.of(
+                    new FieldAccessPostAggregator("value", "value"),
+                    new ConstantPostAggregator("zero", 0)

Review Comment:
   can you use a different value here so the asserts below all get a different 
result with a different value? LGTM otherwise. 



-- 
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]

Reply via email to