Uploaded image for project: 'Tajo (Retired)'
  1. Tajo (Retired)
  2. TAJO-1574

Fix NPE on natural join

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.11.0, 0.10.1
    • None
    • None

    Description

      NPE occurs in a natural join.

      default> create table t(a int);
      default> insert overwrite into t select 1;
      default> create table s(a int);
      default> insert overwrite into s select 1;
      default> select * from t natural join s;
      

      The main reason is joinQual is null.

         public RESULT visitJoin(CONTEXT ctx, Stack<Expr> stack, Join expr) throws PlanningException {
           stack.push(expr);
      -    visit(ctx, stack, expr.getQual());
      +    if (expr.getQual() != null) {
      +      visit(ctx, stack, expr.getQual());
      +    }
      
      -    join.joinQual = (Expr) joinQual.clone();
      +    if (joinQual != null) {
      +      join.joinQual = (Expr) joinQual.clone();
      +    }
      

      After fix, we need to get the following result.

      default> select * from t natural join s;
      Progress: 100%, response time: 0.293 sec
      a,  a
      -------------------------------
      1,  1
      (1 rows, 0.293 sec, 4 B selected)
      

      Attachments

        Activity

          People

            dongjoon Dongjoon Hyun
            dongjoon Dongjoon Hyun
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: