Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-22787

NPE when compiling query contains intersect all

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • Query Planning
    • None
    • Hide
      Fixing CBO makes this unnecessary.
      Reopen if CBO=off path should be supported.
      Show
      Fixing CBO makes this unnecessary. Reopen if CBO=off path should be supported.

    Description

      The query contains INTERSECT ALL operator and one of its operands has an OUTER JOIN like:

      SELECT ... FROM t1 RIGHT OUTER JOIN t2 ON ...
      INTERSECT ALL
      SELECT ...
      

      In this case both AST trees (before and after calcite) has a TOK_INTERSECTALL node and it is not handled
      when generating the plan in

      org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
      private Operator genPlan(QB parent, QBExpr qbexpr) throws SemanticException {
          if (qbexpr.getOpcode() == QBExpr.Opcode.NULLOP) {
            boolean skipAmbiguityCheck = viewSelect == null && parent.isTopLevelSelectStarQuery();
            return genPlan(qbexpr.getQB(), skipAmbiguityCheck);
          }
          if (qbexpr.getOpcode() == QBExpr.Opcode.UNION) {
            Operator qbexpr1Ops = genPlan(parent, qbexpr.getQBExpr1());
            Operator qbexpr2Ops = genPlan(parent, qbexpr.getQBExpr2());
      
            return genUnionPlan(qbexpr.getAlias(), qbexpr.getQBExpr1().getAlias(),
                qbexpr1Ops, qbexpr.getQBExpr2().getAlias(), qbexpr2Ops);
          }
          return null;
        }

      Attachments

        Activity

          People

            kkasa Krisztian Kasa
            kkasa Krisztian Kasa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: