[
https://issues.apache.org/jira/browse/CALCITE-7749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18117063#comment-18117063
]
krooswu commented on CALCITE-7749:
----------------------------------
Thank you, Mihai!
By the way, I recently fixed my GitHub identity, so future commits will all
appear under {*}Dwrite{*}. Some of my previous Calcite contributions were
authored as *krooswu* because of an old Git email configuration, but they were
from the same GitHub account.
> CONCAT (and other STRING_SAME_SAME-typed operators) gives misleading error
> message for mixed CHARACTER/BINARY arguments
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-7749
> URL: https://issues.apache.org/jira/browse/CALCITE-7749
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.42.0
> Reporter: krooswu
> Assignee: krooswu
> Priority: Minor
> Labels: pull-request-available
> 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 requires both operands to be in
> the STRING family AND to be mutually comparable.
> Repro:
>
> sql
> {{SELECT CONCAT('a', x'0a');}}
> Actual error:
>
> {{Cannot apply 'CONCAT' to arguments of type 'CONCAT(<CHAR(1)>, <BINARY(1)>)'.
> Supported form(s): 'CONCAT(<STRING>, <STRING>)'}}
> This is misleading: {{CONCAT}} _does_ accept {{BINARY}} arguments (e.g.
> {{CONCAT(x'0a', x'0b')}} works fine), so the message reads as if BINARY
> support were missing altogether, when the real constraint is that both
> arguments must belong to the same concrete sub-family (both CHARACTER or both
> BINARY). The "Supported form(s)" text should reflect this constraint instead
> of implying any CHARACTER/BINARY mix is allowed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)