chucheng92 commented on code in PR #3706:
URL: https://github.com/apache/calcite/pull/3706#discussion_r1519077366
##########
core/src/main/java/org/apache/calcite/sql/type/ArrayElementOperandTypeChecker.java:
##########
@@ -34,61 +33,64 @@
public class ArrayElementOperandTypeChecker implements SqlOperandTypeChecker {
//~ Instance fields --------------------------------------------------------
- private final boolean allowNullCheck;
- private final boolean allowCast;
+ private final boolean arrayMayBeNull;
+ private final boolean elementMayBeNull;
//~ Constructors -----------------------------------------------------------
- public ArrayElementOperandTypeChecker() {
- this.allowNullCheck = false;
- this.allowCast = false;
- }
-
- public ArrayElementOperandTypeChecker(boolean allowNullCheck, boolean
allowCast) {
- this.allowNullCheck = allowNullCheck;
- this.allowCast = allowCast;
+ public ArrayElementOperandTypeChecker(boolean arrayMayBeNull, boolean
elementMayBeNull) {
+ this.arrayMayBeNull = arrayMayBeNull;
+ this.elementMayBeNull = elementMayBeNull;
}
//~ Methods ----------------------------------------------------------------
@Override public boolean checkOperandTypes(
SqlCallBinding callBinding,
boolean throwOnFailure) {
Review Comment:
If array is not first argument? such as array_xxx(1, array, 2). It seems
that this typechecker only works in this situation.
But I think if this happens, we can add another typechecker or refactor,
such as passing in index to indicate the index of the array parameter.
--
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]