[
https://issues.apache.org/jira/browse/CALCITE-3951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17099634#comment-17099634
]
Ruben Q L commented on CALCITE-3951:
------------------------------------
Thanks for you feedback [~zabetak].
bq. I am not sure if SqlCollation is the place to keep the comparison logic.
Then, what could be the alternative?
As I see it, SqlCollation already represents a (simplified) notion of what is
described in "4.2.2 Comparison of character strings":
- It stores a character set, and we do not allow the comparison of strings
whose SqlCollation's charset are not the same (see
SqlTypeUtil#isCharTypeComparable)
- It stores the "Coercibility" value (EXPLICIT, IMPLICIT, COERCIBLE, NONE),
which reflects the "collation derivation" rules in the standard (see
SqCollation#getCoercibilityDyadic* methods).
One thing that is missing is the actual string comparison process (the goal of
the current ticket). I think that the easiest way to implement it with
(hopefully) the minimum impact of the rest of Calcite classes and full
backwards compatibility, was adding this information as a Collator in
SqlCollation (as I mentioned in the PR, I would agree to annotate the feature
as "Experimental" if we feel that this design might be reviewed in future
versions). As you know ;) this is a quite urgent requirement for us, so it
would be nice to have a functional implementation for this (even Experimental)
in the next release.
> Support different string comparison based on SqlCollation
> ---------------------------------------------------------
>
> Key: CALCITE-3951
> URL: https://issues.apache.org/jira/browse/CALCITE-3951
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Ruben Q L
> Assignee: Ruben Q L
> Priority: Major
> Time Spent: 3h
> Remaining Estimate: 0h
>
> Currently SqlCollation defines concepts like Coercibility, Charset, Locale,
> etc. However, we cannot specify on a certain collation that e.g. a string
> field should use case insensitive comparison. The goal of this ticket is to
> evolve SqlCollation to support that, and adapt the corresponding classes to
> use that (optional) "non-standard" comparison.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)