Examples of VerifyException


Examples of org.apache.tajo.engine.exception.VerifyException

    if (!state.verified()) {
      StringBuilder sb = new StringBuilder();
      for (String error : state.getErrorMessages()) {
        sb.append("ERROR: ").append(error).append("\n");
      }
      throw new VerifyException(sb.toString());
    }

    return plan;
  }
View Full Code Here

Examples of org.apache.tajo.engine.exception.VerifyException

    } else if (setOperation.getType() == OpType.Except) {
      setOp = new ExceptNode(plan.newPID(), leftSubQuery, rightSubQuery);
    } else if (setOperation.getType() == OpType.Intersect) {
      setOp = new IntersectNode(plan.newPID(), leftSubQuery, rightSubQuery);
    } else {
      throw new VerifyException("Invalid Type: " + setOperation.getType());
    }

    // Strip the table names from the targets of the both blocks
    // in order to check the equivalence the schemas of both blocks.
    Target [] leftStrippedTargets = PlannerUtil.stripTarget(leftContext.block.getCurrentTargets());
View Full Code Here

Examples of org.apache.tajo.engine.exception.VerifyException

    projectionNode.setOutSchema(getProjectedSchema(plan, projectionNode.getTargets()));
    projectionNode.setInSchema(child.getOutSchema());
    projectionNode.setChild(child);

    if (projection.isDistinct() && block.hasGrouping()) {
      throw new VerifyException("Cannot support grouping and distinct at the same time");
    } else {
      if (projection.isDistinct()) {
        Schema outSchema = projectionNode.getOutSchema();
        GroupbyNode dupRemoval = new GroupbyNode(plan.newPID(), outSchema.toArray());
        dupRemoval.setTargets(block.getTargetListManager().getTargets());
View Full Code Here

Examples of org.apache.tajo.engine.exception.VerifyException

      Schema schema = relationOp.getTableSchema();

      Column column = schema.getColumnByFQN(columnRef.getCanonicalName());
      if (column == null) {
        throw new VerifyException("ERROR: no such a column '"+ columnRef.getCanonicalName() + "'");
      }

      return column;

    } else { // if a column reference is not qualified

      // if current logical node is available
      if (currentNode != null && currentNode.getOutSchema() != null) {
        Column found = currentNode.getOutSchema().getColumnByName(columnRef.getName());
        if (found != null) {
          return found;
        }
      }

      if (block.getLatestNode() != null) {
        Column found = block.getLatestNode().getOutSchema().getColumnByName(columnRef.getName());
        if (found != null) {
          return found;
        }
      }

      // Trying to find columns from other relations in the current block
      List<Column> candidates = TUtil.newList();
      for (RelationNode rel : block.getRelations()) {
        Column found = rel.getOutSchema().getColumnByName(columnRef.getName());
        if (found != null) {
          candidates.add(found);
        }
      }

      if (!candidates.isEmpty()) {
        return ensureUniqueColumn(candidates);
      }

      // Trying to find columns from other relations in other blocks
      for (QueryBlock eachBlock : queryBlocks.values()) {
        for (RelationNode rel : eachBlock.getRelations()) {
          Column found = rel.getOutSchema().getColumnByName(columnRef.getName());
          if (found != null) {
            candidates.add(found);
          }
        }
      }

      if (!candidates.isEmpty()) {
        return ensureUniqueColumn(candidates);
      }

      throw new VerifyException("ERROR: no such a column name "+ columnRef.getCanonicalName());
    }
  }
View Full Code Here

Examples of org.apache.tajo.engine.exception.VerifyException

        } else {
          sb.append(", ");
        }
        sb.append(column);
      }
      throw new VerifyException("Ambiguous Column Name: " + sb.toString());
    } else {
      return null;
    }
  }
View Full Code Here

Examples of org.apache.tajo.engine.exception.VerifyException

    if (!state.verified()) {
      StringBuilder sb = new StringBuilder();
      for (String error : state.getErrorMessages()) {
        sb.append(error).append("\n");
      }
      throw new VerifyException(sb.toString());
    }

    LogicalPlan plan = planner.createPlan(session, expression);
    LOG.info("=============================================");
    LOG.info("Non Optimized Query: \n" + plan.toString());
    LOG.info("=============================================");
    optimizer.optimize(plan);
    LOG.info("=============================================");
    LOG.info("Optimized Query: \n" + plan.toString());
    LOG.info("=============================================");

    annotatedPlanVerifier.verify(session, state, plan);

    if (!state.verified()) {
      StringBuilder sb = new StringBuilder();
      for (String error : state.getErrorMessages()) {
        sb.append(error).append("\n");
      }
      throw new VerifyException(sb.toString());
    }

    return plan;
  }
View Full Code Here

Examples of org.apache.tajo.engine.exception.VerifyException

    if (!candidates.isEmpty()) {
      return ensureUniqueColumn(candidates);
    }

    throw new VerifyException("ERROR: no such a column name "+ columnRef.getCanonicalName());
  }
View Full Code Here

Examples of org.apache.tajo.engine.exception.VerifyException

        } else {
          sb.append(", ");
        }
        sb.append(column);
      }
      throw new VerifyException("Ambiguous Column Name: " + sb.toString());
    } else {
      return null;
    }
  }
View Full Code Here

Examples of org.apache.tajo.engine.exception.VerifyException

    projectionNode.setInSchema(child.getOutSchema());
    projectionNode.setTargets(targets);
    projectionNode.setChild(child);

    if (projection.isDistinct() && block.hasNode(NodeType.GROUP_BY)) {
      throw new VerifyException("Cannot support grouping and distinct at the same time yet");
    } else {
      if (projection.isDistinct()) {
        insertDistinctOperator(context, projectionNode, child, stack);
      }
    }
View Full Code Here

Examples of org.apache.tajo.engine.exception.VerifyException

    QueryBlock block = context.queryBlock;

    ExprNormalizedResult normalizedResult = normalizer.normalize(context, selection.getQual());
    block.namedExprsMgr.addExpr(normalizedResult.baseExpr);
    if (normalizedResult.aggExprs.size() > 0 || normalizedResult.scalarExprs.size() > 0) {
      throw new VerifyException("Filter condition cannot include aggregation function");
    }

    ////////////////////////////////////////////////////////
    // Visit and Build Child Plan
    ////////////////////////////////////////////////////////
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.