NobiGo commented on code in PR #4082:
URL: https://github.com/apache/calcite/pull/4082#discussion_r1877355683
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -8221,36 +8221,36 @@ void checkArrayReverseFunc(SqlOperatorFixture f0,
SqlFunction function,
+ "and not exceeds the allowed limit.", true);
f1.checkScalar("array_insert(array[1, 2, 3], 3, 4)",
- "[1, 2, 4, 3]", "INTEGER NOT NULL ARRAY NOT NULL");
+ "[1, 2, 4, 3]", "INTEGER ARRAY NOT NULL");
f1.checkScalar("array_insert(array[1, 2, 3], 3, cast(null as integer))",
"[1, 2, null, 3]", "INTEGER ARRAY NOT NULL");
f1.checkScalar("array_insert(array[2, 3, 4], 1, 1)",
- "[1, 2, 3, 4]", "INTEGER NOT NULL ARRAY NOT NULL");
+ "[1, 2, 3, 4]", "INTEGER ARRAY NOT NULL");
f1.checkScalar("array_insert(array[1, 3, 4], -1, 2)",
- "[1, 3, 4, 2]", "INTEGER NOT NULL ARRAY NOT NULL");
+ "[1, 3, 4, 2]", "INTEGER ARRAY NOT NULL");
f1.checkScalar("array_insert(array[1, 3, 4], -3, 2)",
- "[1, 2, 3, 4]", "INTEGER NOT NULL ARRAY NOT NULL");
+ "[1, 2, 3, 4]", "INTEGER ARRAY NOT NULL");
f1.checkScalar("array_insert(array[2, 3, null, 4], -6, 1)",
"[1, null, 2, 3, null, 4]", "INTEGER ARRAY NOT NULL");
Review Comment:
Yes, I overlooked this and only covered the correctness of the Array data
type outside.
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -8221,36 +8221,36 @@ void checkArrayReverseFunc(SqlOperatorFixture f0,
SqlFunction function,
+ "and not exceeds the allowed limit.", true);
f1.checkScalar("array_insert(array[1, 2, 3], 3, 4)",
- "[1, 2, 4, 3]", "INTEGER NOT NULL ARRAY NOT NULL");
+ "[1, 2, 4, 3]", "INTEGER ARRAY NOT NULL");
f1.checkScalar("array_insert(array[1, 2, 3], 3, cast(null as integer))",
"[1, 2, null, 3]", "INTEGER ARRAY NOT NULL");
f1.checkScalar("array_insert(array[2, 3, 4], 1, 1)",
- "[1, 2, 3, 4]", "INTEGER NOT NULL ARRAY NOT NULL");
+ "[1, 2, 3, 4]", "INTEGER ARRAY NOT NULL");
f1.checkScalar("array_insert(array[1, 3, 4], -1, 2)",
- "[1, 3, 4, 2]", "INTEGER NOT NULL ARRAY NOT NULL");
+ "[1, 3, 4, 2]", "INTEGER ARRAY NOT NULL");
f1.checkScalar("array_insert(array[1, 3, 4], -3, 2)",
- "[1, 2, 3, 4]", "INTEGER NOT NULL ARRAY NOT NULL");
+ "[1, 2, 3, 4]", "INTEGER ARRAY NOT NULL");
f1.checkScalar("array_insert(array[2, 3, null, 4], -6, 1)",
"[1, null, 2, 3, null, 4]", "INTEGER ARRAY NOT NULL");
Review Comment:
Can we strengthen this `checkScalar` method? Can detect if other functions
have similar issues. This may be an overlooked testing point. WDYT?
--
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]