[
https://issues.apache.org/jira/browse/CALCITE-632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14371805#comment-14371805
]
Julian Hyde commented on CALCITE-632:
-------------------------------------
Your fix makes the look-up less efficient. It has to scan the whole list,
whereas currently it can stop when it finds the first match.
Could the comparator be adapted a bit? If x and y are not ancestors of each
other, then we compare based on their class name. Then the comparator is
consistent (i.e. it defines a total order) and it has the required property
that superclasses occur before subclasses.
> Sort order returned by SUPERCLASS_COMPARATOR in ReflectiveRelMetadataProvider
> is inconsistent
> ---------------------------------------------------------------------------------------------
>
> Key: CALCITE-632
> URL: https://issues.apache.org/jira/browse/CALCITE-632
> Project: Calcite
> Issue Type: Bug
> Reporter: Jesus Camacho Rodriguez
> Assignee: Jesus Camacho Rodriguez
>
> By default, 1 is returned. However, when none of the classes is a super class
> of the other one, this could lead to inconsistent order as the Comparable
> will return the same result e.g. compare(Exchange, Sort) = 1 and
> compare(Sort, Exchange) = 1.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)