liuyongvs commented on code in PR #3212:
URL: https://github.com/apache/calcite/pull/3212#discussion_r1209646097
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -5336,6 +5336,36 @@ private static void checkIf(SqlOperatorFixture f) {
f.checkNull("array_distinct(null)");
}
+ /** Tests {@code ARRAY_MAX} function from Spark. */
+ @Test void testArrayMaxFunc() {
+ final SqlOperatorFixture f0 = fixture();
+ f0.setFor(SqlLibraryOperators.ARRAY_MAX);
+ f0.checkFails("^array_max(array[1, 2])^",
+ "No match found for function signature ARRAY_MAX\\(<INTEGER
ARRAY>\\)", false);
+
+ final SqlOperatorFixture f = f0.withLibrary(SqlLibrary.SPARK);
+ f.checkScalar("array_max(array[1, 2])", "2",
Review Comment:
@MasseGuillaume thanks, add the test.
and the type should always nullable, which you can see here
```
case class ArrayMax(child: Expression)
extends UnaryExpression with ImplicitCastInputTypes with NullIntolerant {
override def nullable: Boolean = true
```
https://github.com/apache/spark/blob/014dd357656106cc8dc0fcfb30cbe067a714916c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala#L2126
--
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]