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

hongbin ma updated KYLIN-2608:
------------------------------
    Description: 
The bug may cause model unable to match when PK/FK contains multiple columns

{code}
         int n = foreignKey.length;
         for (int i = 0; i < n - 1 && cont; i++) {
             cont = false;
-            for (int j = i; j < n - 1; j++) {
+            for (int j = 0; j < n - 1 - i; j++) {
                 int jj = j + 1;
                 if (foreignKey[j].compareTo(foreignKey[jj]) > 0) {
                     swap(foreignKey, j, jj);

{code}

  was:
{code}
         int n = foreignKey.length;
         for (int i = 0; i < n - 1 && cont; i++) {
             cont = false;
-            for (int j = i; j < n - 1; j++) {
+            for (int j = 0; j < n - 1 - i; j++) {
                 int jj = j + 1;
                 if (foreignKey[j].compareTo(foreignKey[jj]) > 0) {
                     swap(foreignKey, j, jj);

{code}


> Bubble sort bug in JoinDesc
> ---------------------------
>
>                 Key: KYLIN-2608
>                 URL: https://issues.apache.org/jira/browse/KYLIN-2608
>             Project: Kylin
>          Issue Type: Bug
>            Reporter: hongbin ma
>            Assignee: hongbin ma
>
> The bug may cause model unable to match when PK/FK contains multiple columns
> {code}
>          int n = foreignKey.length;
>          for (int i = 0; i < n - 1 && cont; i++) {
>              cont = false;
> -            for (int j = i; j < n - 1; j++) {
> +            for (int j = 0; j < n - 1 - i; j++) {
>                  int jj = j + 1;
>                  if (foreignKey[j].compareTo(foreignKey[jj]) > 0) {
>                      swap(foreignKey, j, jj);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to