Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.11.0, 0.10.1
    • Component/s: None
    • Labels:
      None

      Description

      When `Expr.clone()` is called, various errors(NPE/TypeCastingError/recursive/functional error) are occurs. This issue should be solved for others issues reusing `Expr`. Please refer the following code.

      • NPE case (Aggregation.java, UnaryOperator.java, CreateTable, AlterTable)
        -    aggregation.namedExprs = new NamedExpr[namedExprs.length];
        -    for (int i = 0; i < namedExprs.length; i++) {
        -      aggregation.namedExprs[i] = (NamedExpr) namedExprs[i].clone();
        +    if (namedExprs != null) {
        +      aggregation.namedExprs = new NamedExpr[namedExprs.length];
        +      for (int i = 0; i < namedExprs.length; i++) {
        +        aggregation.namedExprs[i] = (NamedExpr) namedExprs[i].clone();
        +      }
             }
         
        -    aggregation.groups = new GroupElement[groups.length];
        -    for (int i = 0; i < groups.length; i++) {
        -      aggregation.groups[i] = (GroupElement) groups[i].clone();
        +    if (groups != null) {
        +      aggregation.groups = new GroupElement[groups.length];
        +      for (int i = 0; i < groups.length; i++) {
        +        aggregation.groups[i] = (GroupElement) groups[i].clone();
        +      }
             }
        
      -    alter.addNewColumn = (ColumnDefinition) addNewColumn.clone();
      +    if (addNewColumn != null) {
      +      alter.addNewColumn = (ColumnDefinition) addNewColumn.clone();
      +    }
      
      • Recursive (BetweenPredicate.java)
        -    between.begin = (Expr) between.clone();
        +    between.begin = (Expr) begin.clone();
        
      • Type Casting Error (ValueListExpr.java)
        -      valueListExpr.values = (Expr[]) values[i].clone();
        +      valueListExpr.values[i] = (Expr) values[i].clone();
        
      • Functional Error (CreateTable.java)
        -      if (range.specifiers != null) {
        +      if (specifiers != null) {
        
      1. TAJO-1512.Hyun.150403.0.patch
        3 kB
        Dongjoon Hyun
      2. TAJO-1512.Hyun.150404.0.patch
        10 kB
        Dongjoon Hyun

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user dongjoon-hyun opened a pull request:

          https://github.com/apache/tajo/pull/504

          TAJO-1512: Fix Aggregation.clone NPE bug

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/dongjoon-hyun/tajo TAJO-1512

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/tajo/pull/504.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #504


          commit c929b5b49866e29b2b948277387856017f26fbcb
          Author: Dongjoon Hyun <dongjoon@apache.org>
          Date: 2015-04-03T06:00:52Z

          TAJO-1512: Fix Aggregation.clone NPE bug


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user dongjoon-hyun opened a pull request: https://github.com/apache/tajo/pull/504 TAJO-1512 : Fix Aggregation.clone NPE bug You can merge this pull request into a Git repository by running: $ git pull https://github.com/dongjoon-hyun/tajo TAJO-1512 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/504.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #504 commit c929b5b49866e29b2b948277387856017f26fbcb Author: Dongjoon Hyun <dongjoon@apache.org> Date: 2015-04-03T06:00:52Z TAJO-1512 : Fix Aggregation.clone NPE bug
          Hide
          tajoqa Tajo QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12709184/TAJO-1512.Hyun.150403.0.patch
          against master revision release-0.9.0-rc0-236-g70d5fdf.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 1 new or modified test files.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. The applied patch does not increase the total number of javadoc warnings.

          +1 checkstyle. The patch generated 0 code style errors.

          +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in tajo-algebra.

          Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/694//testReport/
          Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/694//console

          This message is automatically generated.

          Show
          tajoqa Tajo QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12709184/TAJO-1512.Hyun.150403.0.patch against master revision release-0.9.0-rc0-236-g70d5fdf. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 1 new or modified test files. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The applied patch does not increase the total number of javadoc warnings. +1 checkstyle. The patch generated 0 code style errors. +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in tajo-algebra. Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/694//testReport/ Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/694//console This message is automatically generated.
          Hide
          tajoqa Tajo QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12709408/TAJO-1512.Hyun.150404.0.patch
          against master revision release-0.9.0-rc0-236-g70d5fdf.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 1 new or modified test files.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. The applied patch does not increase the total number of javadoc warnings.

          +1 checkstyle. The patch generated 0 code style errors.

          +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in tajo-algebra.

          Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/701//testReport/
          Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/701//console

          This message is automatically generated.

          Show
          tajoqa Tajo QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12709408/TAJO-1512.Hyun.150404.0.patch against master revision release-0.9.0-rc0-236-g70d5fdf. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 1 new or modified test files. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The applied patch does not increase the total number of javadoc warnings. +1 checkstyle. The patch generated 0 code style errors. +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in tajo-algebra. Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/701//testReport/ Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/701//console This message is automatically generated.
          Hide
          dongjoon Dongjoon Hyun added a comment -

          contained by TAJO-1430 and committed already.

          Show
          dongjoon Dongjoon Hyun added a comment - contained by TAJO-1430 and committed already.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dongjoon-hyun closed the pull request at:

          https://github.com/apache/tajo/pull/504

          Show
          githubbot ASF GitHub Bot added a comment - Github user dongjoon-hyun closed the pull request at: https://github.com/apache/tajo/pull/504

            People

            • Assignee:
              dongjoon Dongjoon Hyun
              Reporter:
              dongjoon Dongjoon Hyun
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development