You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Vladimir Sitnikov (JIRA)" <ji...@apache.org> on 2018/09/24 21:03:00 UTC

[jira] [Resolved] (CALCITE-2591) EnumerableDefaults#mergeJoin should throw error and not return incorrect results when inputs are not ordered

     [ https://issues.apache.org/jira/browse/CALCITE-2591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladimir Sitnikov resolved CALCITE-2591.
----------------------------------------
    Resolution: Fixed

Fixed in https://git-wip-us.apache.org/repos/asf?p=calcite.git;a=commit;h=b9da74ee3baed9ef6bd16472cf4a34515e3e29ab

> EnumerableDefaults#mergeJoin should throw error and not return incorrect results when inputs are not ordered
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-2591
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2591
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: Enrico Olivelli
>            Assignee: Julian Hyde
>            Priority: Critical
>             Fix For: 1.18.0
>
>
> The merge join implementation should throw a runtime error in case of unsorted inputs.
>  
> The assertion  is already present but it is done with Java 'assert' keywork, this makes the assertion not to be evaluated in production.
> It happened in production that due to a bug (out of the scope of this issue) a merge join was fed by an input which was not sorted according to the merge sort keys
> This is current code in 1.17
> {code:java}
> int c = leftKey.compareTo(leftKey2);
>         if (c != 0) {
>           assert c < 0 : "not sorted";
>           break;
>         }{code}
>  
> This change will enable that assertion even when Java assertions are not enabled.
> The impact is not very significant (a few CPU cycles) but prevents invalid results to be returned by the query.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)