[
https://issues.apache.org/jira/browse/CALCITE-6409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17846030#comment-17846030
]
Julian Hyde commented on CALCITE-6409:
--------------------------------------
Who said the types need to be comparable? Comparable means I can use them in an
expression like 'x < y'. For NVL and NVL2 we need them to be assignable to a
most general type, as in 'w = b ? x : y' in Java, and also similar to CASE and
UNION SQL operators.
[~mbudiu], I think some confusion arises because SameOperandTypeChecker says
operands "must be comparable"; it has a subclass ComparableTypeChecker, so what
would be the purpose of that subclass? I wonder whether SameOperandTypeChecker
has been used for functions that it should not be; and once those functions
used it wrongly, someone changed the definition of 'same' to make those
functions work.
> Char types and Boolean types are comparable
> -------------------------------------------
>
> Key: CALCITE-6409
> URL: https://issues.apache.org/jira/browse/CALCITE-6409
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.37.0
> Reporter: Caican Cai
> Priority: Critical
> Fix For: 1.38.0
>
>
> In the SameOperandTypeChecker method, the char type and the boolean type are
> comparable because of the call to the isComparable method.
> Comparability of char types and boolean types returns true in the
> isComparable method.
> However, char types and Boolean types in Spark are incomparable. Does Calcite
> have fixed standards here?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)