Mihai Budiu created CALCITE-7615:
------------------------------------
Summary: MAP_CONCAT does not accept NULL as an argument
Key: CALCITE-7615
URL: https://issues.apache.org/jira/browse/CALCITE-7615
Project: Calcite
Issue Type: Improvement
Components: core
Affects Versions: 1.42.0
Reporter: Mihai Budiu
MAP_CONCAT will throw if any argument is the NULL literal:
{code:java}
Function 'MAP_CONCAT' should all be of type map, but it is 'NULL' {code}
The bug is in SqlLibraryOperators.deriveTypeMapConcat
{code:java}
if (!SqlTypeUtil.isMap(operandType)) {
throw opBinding.newError(
RESOURCE.typesShouldAllBeMap(
opBinding.getOperator().getName(),
operandType.getFullTypeString()));
}{code}
Moreover, the error message is not very good, it should say "arguments should
be all of type MAP".
There is even a test in SqlOperatorTest for this case, which I think is wrong.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)