chenyuzhi459 commented on a change in pull request #11088:
URL: https://github.com/apache/druid/pull/11088#discussion_r611532181
##########
File path: core/src/test/java/org/apache/druid/math/expr/FunctionTest.java
##########
@@ -407,12 +407,40 @@ public void testRoundWithExtremeNumbers()
assertExpr("round(CAST(minLong, 'DOUBLE') - 1, -2)",
BigDecimal.valueOf(((double) Long.MIN_VALUE) - 1).setScale(-2,
RoundingMode.HALF_UP).doubleValue());
}
+ @Test
+ public void testRoundWithNullValue()
+ {
+ Set<Pair<String, String>> invalidArguments = ImmutableSet.of(
+ Pair.of("null", "STRING"),
+ Pair.of("x", "STRING")
+ );
+ for (Pair<String, String> argAndType : invalidArguments) {
+ if (NullHandling.sqlCompatible()) {
+ assertExpr(String.format(Locale.ENGLISH, "round(%s)", argAndType.lhs),
null);
Review comment:
Sorry, I don't understand what you mean. Could you explain more details?
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]