Fixing expected results for infinity

This commit is contained in:
Soumyava Das 2021-11-15 12:29:32 -08:00
parent 4d64aaef64
commit 5fd5cd480d
3 changed files with 5 additions and 4 deletions

View File

@ -37,6 +37,7 @@ import org.junit.Test;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.validation.constraints.Null;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.Locale; import java.util.Locale;
@ -788,8 +789,8 @@ public class FunctionTest extends InitializedNullHandlingTest
// NaN and Infinity cases // NaN and Infinity cases
assertExpr("safe_divide(NaN, 0.0)", NullHandling.defaultDoubleValue()); assertExpr("safe_divide(NaN, 0.0)", NullHandling.defaultDoubleValue());
assertExpr("safe_divide(0, NaN)", 0.0); assertExpr("safe_divide(0, NaN)", 0.0);
assertExpr("safe_divide(0, POSITIVE_INFINITY)", 0L); assertExpr("safe_divide(0, POSITIVE_INFINITY)", NullHandling.defaultLongValue());
assertExpr("safe_divide(POSITIVE_INFINITY,0)", 0L); assertExpr("safe_divide(POSITIVE_INFINITY,0)", NullHandling.defaultLongValue());
} }
@Test @Test

View File

@ -1032,7 +1032,7 @@ public class CalciteQueryTest extends BaseCalciteQueryTest
expected = ImmutableList.of( expected = ImmutableList.of(
new Object[]{null, null, null, 7.0F}, new Object[]{null, null, null, 7.0F},
new Object[]{1.0F, 1L, 1.0, 3253230.0F}, new Object[]{1.0F, 1L, 1.0, 3253230.0F},
new Object[]{0.0F, 0L, 0, 0.0F}, new Object[]{0.0F, 0L, 0.0, 0.0F},
new Object[]{null, null, null, null}, new Object[]{null, null, null, null},
new Object[]{null, null, null, null}, new Object[]{null, null, null, null},
new Object[]{null, null, null, null} new Object[]{null, null, null, null}