mihaibudiu commented on code in PR #4080:
URL: https://github.com/apache/calcite/pull/4080#discussion_r1874096297
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -1524,23 +1524,24 @@ private static RelDataType
arrayCompactReturnType(SqlOperatorBinding opBinding)
private static RelDataType arrayInsertReturnType(SqlOperatorBinding
opBinding) {
final RelDataType arrayType = opBinding.collectOperandTypes().get(0);
final RelDataType componentType = arrayType.getComponentType();
- final RelDataType elementType = opBinding.collectOperandTypes().get(2);
+ final RelDataType elementType1 = opBinding.collectOperandTypes().get(1);
Review Comment:
This function collectOperandTypes() is called 3 times. If it allocates a new
list, the list should probably be reused.
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -11692,9 +11683,9 @@ void assertSubFunReturns(boolean binary, String s, int
start,
f12.checkScalar("NVL2(NULL, 3.0, 2.111)", "2.111", "DECIMAL(4, 3) NOT
NULL");
f12.checkScalar("NVL2(3.111, 3.1415926, 2.111)", "3.1415926",
"DECIMAL(8, 7) NOT NULL");
- f12.checkNullValueWithNullableType("nvl2('ab', CAST(NULL AS VARCHAR(6)),
'def')");
- f12.checkNullValueWithNullableType("nvl2(NULL, 'abc', NULL)");
- f12.checkNullValueWithNullableType("nvl2(NULL, NULL, NULL)");
+ f12.checkNull("nvl2('ab', CAST(NULL AS VARCHAR(6)), 'def')");
Review Comment:
I thought you also meant to change checkNull to assert that the type is
nullable.
Or is that already happening?
--
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]