rubenada commented on code in PR #3214:
URL: https://github.com/apache/calcite/pull/3214#discussion_r1203727760
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -5539,6 +5539,72 @@ private static void checkIf(SqlOperatorFixture f) {
f.checkNull("atan2(1, cast(null as double))");
}
+ @Test void testAcoshFunc() {
+ final SqlOperatorFixture f0 = fixture().setFor(SqlLibraryOperators.ACOSH);
+ f0.checkFails("^acosh(1)^",
+ "No match found for function signature ACOSH\\(<NUMERIC>\\)",
+ false);
+ final Consumer<SqlOperatorFixture> consumer = f -> {
+ f.checkType("acosh(1)", "DOUBLE NOT NULL");
+ f.checkType("acosh(cast(1 as Decimal))", "DOUBLE NOT NULL");
+ f.checkType("acosh(case when false then 1 else null end)", "DOUBLE");
+ f.checkType("acosh('abc')", "DOUBLE NOT NULL");
+ f.checkScalarApprox("acosh(1)", "DOUBLE NOT NULL",
+ isWithin(0d, 0.0001d));
+ f.checkScalarApprox("acosh(cast(10 as decimal))", "DOUBLE NOT NULL",
+ isWithin(2.9932d, 0.0001d));
+ f.checkNull("acosh(cast(null as integer))");
+ f.checkNull("acosh(cast(null as double))");
+ f.checkFails("acosh(0.1)",
+ "Input parameter of acosh cannot be small than 1!",
Review Comment:
Ah, ok. Thanks for the info. It is certainly counter-intuitive and probably
there's room for improvement, but IMO this is out of the scope of the current
PR.
I would say, please just align this "expected error message" with the actual
error that is thrown, just for the sake of correctness (and in case the fixture
mechanism gets improved in the future).
--
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]