[
https://issues.apache.org/jira/browse/CALCITE-7748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18144698#comment-18144698
]
krooswu commented on CALCITE-7748:
----------------------------------
Duplicate of https://issues.apache.org/jira/browse/CALCITE-7749, which has
already been resolved in
[https://github.com/apache/calcite/commit/7359405d8794f5198cc4188c13aaea0f3dd13402]
. Closing this one now, thanks!
> CONCAT (and other STRING_SAME_SAME-typed operators) gives misleading error
> message for mixed CHARACTER/BINARY arguments
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-7748
> URL: https://issues.apache.org/jira/browse/CALCITE-7748
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.42.0
> Reporter: krooswu
> Assignee: krooswu
> Priority: Minor
> Fix For: 1.43.0
>
>
> {{SqlTypeFamily.STRING}} is an aggregate family that covers both
> {{CHARACTER}} and {{{}BINARY{}}}. Operators like {{CONCAT}} use
> {{{}OperandTypes.STRING_SAME_SAME{}}}, which is defined as:
>
> java
> {{STRING_SAME_SAME = STRING_STRING.and(SAME_SAME);}}
> {{STRING_STRING}} checks each operand independently against the aggregate
> {{STRING}} family, so a {{CHAR}} argument and a {{BINARY}} argument each pass
> on their own. The actual constraint that rejects mixed CHARACTER/BINARY calls
> comes from the second, AND-composed rule, {{{}SAME_SAME{}}}, which requires
> the operands to be mutually comparable (i.e. share the same _concrete_
> family).
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)