[
https://issues.apache.org/jira/browse/CALCITE-5814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18047590#comment-18047590
]
Zhen Chen commented on CALCITE-5814:
------------------------------------
I'd like to confirm whether we need to sort the data before performing constant
map comparisons. I've noticed that DuckDB and ClickHouse support comparisons of
constant maps, while MySQL, PgSQL, and Doris do not. However, I've also noticed
that DuckDB and ClickHouse don't perform sorting during comparisons; for
example, `map(3,4,1,2) = map(1,2,3,4)` will return false. But this doesn't
necessarily mean we should implement it the same way. I'm discussing this with
[~mbudiu] , and their implementation sorts the data before comparing. So, my
question is, what kind of logic should we implement?
> Simplify 'a = MAP[1,2] AND a = MAP[2,3]' to 'FALSE'
> ---------------------------------------------------
>
> Key: CALCITE-5814
> URL: https://issues.apache.org/jira/browse/CALCITE-5814
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.34.0
> Reporter: Runkang He
> Assignee: Runkang He
> Priority: Major
>
> Currently the following expression with const map literal is not simplified
> to FALSE:
> {code:sql}
> a = MAP[1,2] AND a = MAP[2,3]
> {code}
> Since the map type is an extension to the SQL standard, it's not clear
> whether it is comparable or not. If comparable, it would be nice to simplify
> above expression to FALSE.
> Welcome to discuss or provide some information.
> Note that this Jira is inspired from discussion of
> [CALCITE-5733|https://issues.apache.org/jira/browse/CALCITE-5733].
--
This message was sent by Atlassian Jira
(v8.20.10#820010)