[CALCITE-6300] Function MAP_VALUES/MAP_KEYS gives exception when mapVauleType and mapKeyType not equals map Biggest mapKeytype or mapValueType#3970
Conversation
…auleType and mapKeyType not equals map Biggest mapKeytype or mapValueType
|
| operandsmap.add(i, operands.get(i)); | ||
| } | ||
| } | ||
| call.setOperand(0, castMapTo(operandsmap)); |
There was a problem hiding this comment.
the question we haven't resolved properly is whether the type checker is allowed to mutate the expression that is being checked.
There was a problem hiding this comment.
You're right @mihaibudiu .
Looking a bit in detail, it seems there is already some existing code that calls call.setOperand on this file, e.g. inside adjustTypeForArrayFunctions or adjustTypeForMultisetConstructor; however, these methods seem to be called from a SqlReturnTypeInference (not from a SqlOperandTypeInference). Am I correct?
@caicancai would it be possible to adapt this patch so that the new code is contained in a SqlReturnTypeInference (where there is precedence on Calcite about such modifications)?
There was a problem hiding this comment.
@rubenada ok, My first version of the solution is actually to modify SqlOperandTypeInference. I will fix this pr later.
There was a problem hiding this comment.
Is there a reason to think these changes were not wrong as well?
There was a problem hiding this comment.
If the ReturnTypeInference is allowed to change the arguments, hopefully this fact is documented somewhere
There was a problem hiding this comment.
I will send an email to discuss later. If it is not suitable, I will remove 1.38.0 from this jira.



https://issues.apache.org/jira/browse/CALCITE-6300