[
https://issues.apache.org/jira/browse/CALCITE-632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14372157#comment-14372157
]
Jesus Camacho Rodriguez edited comment on CALCITE-632 at 3/20/15 9:31 PM:
--------------------------------------------------------------------------
I am not convinced about the change in the comparator; when you use this kind
of chained comparator that you propose, order of insertion could still play a
role in the order of the output. Specifically, things may not be output in the
order that you need them. Consider you insert Sort, HiveExchange and Exchange
in that order, and that HiveExchange extends Exchange; if compare(Exchange,
Sort)=1, and compare(HiveExchange, Sort)=-1, you will get Exchange before
HiveExchange, which is not the correct order in the hierarchy.
I am creating a new pull request with code that would improve efficiency, as it
would create and store the calls the first time that it goes through the
hierarchy.
was (Author: jcamachorodriguez):
I am not convinced about the change in the comparator; when you use this kind
of chained comparator that you propose, order of insertion could still play a
role in the order of the output. Specifically, things may not be output in the
order that you need them. Consider you insert Sort, HiveExchange and Exchange
in that order, and that HiveExchange extends Exchange; if compare(Exchange,
Sort)=1, and compare(HiveExchange, Sort)=-1, you will get Exchange before
HiveExchange, which is not the correct order in the hierarchy.
I am creating a new pull request with code that would improve efficiency, as it
would create and store the hierarchy the first time that it goes through it.
> 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)