Package org.teiid.api.exception.query

Examples of org.teiid.api.exception.query.QueryPlannerException


            // make sure that the name in source is defined for this node, so that it can be used
            // in the orderby. static nodes do not qualify for ordering.
            if (elementNode.getNameInSource() == null){
                Object[] params = new Object[] {elementNode, orderBy};
                String msg = QueryPlugin.Util.getString("XMLPlanner.The_XML_document_element_{0}_is_not_mapped_to_data_and_cannot_be_used_in_the_ORDER_BY_clause__{1}_1", params); //$NON-NLS-1$
                throw new QueryPlannerException(msg);
            }
           
            MappingSourceNode sourceNode = elementNode.getSourceNode();
            ResultSetInfo rs = sourceNode.getResultSetInfo();
            OrderBy by = rs.getOrderBy();
View Full Code Here


                }
                instruction = new WhileInstruction(whileProgram, whileStmt.getCondition());
                break;
            }
      default:
            throw new QueryPlannerException(QueryPlugin.Util.getString("ProcedurePlanner.bad_stmt", stmtType)); //$NON-NLS-1$
    }
    return instruction;
    }
View Full Code Here

        if (query == null) {
            try {
                query = QueryParser.getQueryParser().parseCommand(queryNode.getQuery());
                QueryResolver.resolveWithBindingMetadata(query, env.getGlobalMetadata().getDesignTimeMetadata(), queryNode, true);
            } catch (TeiidException e) {
                throw new QueryPlannerException(e, QueryPlugin.Util.getString("ERR.015.004.0054", new Object[]{groupName, queryNode.getQuery()})); //$NON-NLS-1$
      }
        }
        return query;
    }
View Full Code Here

    static Command rewriteQuery(Command query, QueryMetadataInterface metadata, CommandContext context)
        throws QueryPlannerException, TeiidComponentException {
        try {
            return QueryRewriter.rewrite(query, metadata, context);
        } catch(TeiidProcessingException e) {
            throw new QueryPlannerException(e, e.getMessage());
        }
    }
View Full Code Here

        try {
            GroupSymbol gs = new GroupSymbol(groupName);
            ResolverUtil.resolveGroup(gs, metadata);
            queryNode = metadata.getVirtualPlan(gs.getMetadataID());
        } catch (QueryResolverException e) {
            throw new QueryPlannerException(e, "ERR.015.004.0029", QueryPlugin.Util.getString("ERR.015.004.0029", groupName)); //$NON-NLS-1$ //$NON-NLS-2$
        }
        return queryNode;
    }   
View Full Code Here

               
                continue;
            }
           
            if (!singleParentage) {
                throw new QueryPlannerException(QueryPlugin.Util.getString("XMLQueryPlanner.cannot_plan", rsInfo.getCriteria())); //$NON-NLS-1$
            }
           
            Query subQuery = QueryUtil.wrapQuery(new SubqueryFromClause(inlineViewName, command), inlineViewName);

            currentQuery.setCriteria(Criteria.combineCriteria(currentQuery.getCriteria(), new ExistsCriteria(subQuery)));
View Full Code Here

       
        PlanNode plan;
    try {
      plan = generatePlan(command);
    } catch (TeiidProcessingException e) {
      throw new QueryPlannerException(e, e.getMessage());
    }

    if(debug) {
            analysisRecord.println("\nCANONICAL PLAN: \n" + plan); //$NON-NLS-1$
    }
View Full Code Here

        container instanceof TranslatableProcedureContainer //we force the evaluation of procedure params - TODO: inserts are fine except for nonpushdown functions on columns
        && !CriteriaCapabilityValidatorVisitor.canPushLanguageObject(container, metadata.getModelID(container.getGroup().getMetadataID()), metadata, capFinder, analysisRecord)) {
      //do a workaround of row-by-row processing for update/delete
      if (metadata.getUniqueKeysInGroup(container.getGroup().getMetadataID()).isEmpty()
          || !CapabilitiesUtil.supports(Capability.CRITERIA_COMPARE_EQ, metadata.getModelID(container.getGroup().getMetadataID()), metadata, capFinder)) {
        throw new QueryPlannerException(QueryPlugin.Util.getString("RelationalPlanner.nonpushdown_command", container)); //$NON-NLS-1$
      }
     
      //treat this as an update procedure
      if (container instanceof Update) {
        c = QueryRewriter.createUpdateProcedure((Update)container, metadata, context);
      } else {
        c = QueryRewriter.createDeleteProcedure((Delete)container, metadata, context);
      }
      addNestedCommand(sourceNode, container.getGroup(), container, c, false);
      return false;
    }
   
    //plan any subqueries in criteria/parameters/values
    for (SubqueryContainer<?> subqueryContainer : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(container)) {
      if (c == null && container.getGroup().isTempTable()) {
        if (subqueryContainer.getCommand().getCorrelatedReferences() == null) {
          if (subqueryContainer instanceof ScalarSubquery) {
            ((ScalarSubquery) subqueryContainer).setShouldEvaluate(true);
          } else if (subqueryContainer instanceof ExistsCriteria) {
            ((ExistsCriteria) subqueryContainer).setShouldEvaluate(true);
          } else {
            throw new QueryPlannerException(QueryPlugin.Util.getString("RelationalPlanner.nonpushdown_command", container)); //$NON-NLS-1$
          }
        } else {
          throw new QueryPlannerException(QueryPlugin.Util.getString("RelationalPlanner.nonpushdown_command", container)); //$NON-NLS-1$
        }
        }
      ProcessorPlan plan = QueryOptimizer.optimizePlan(subqueryContainer.getCommand(), metadata, null, capFinder, analysisRecord, context);
        subqueryContainer.getCommand().setProcessorPlan(plan);
       
View Full Code Here

                        critNode.setProperty(NodeConstants.Info.IS_PUSHED, Boolean.TRUE);
                        currentNode.setProperty(NodeConstants.Info.IS_DEPENDENT_SET, Boolean.TRUE);
                        return currentNode.getFirstChild();
                    }
        } catch(QueryMetadataException e) {
                    throw new QueryPlannerException(e, QueryPlugin.Util.getString("ERR.015.004.0020", currentNode.getGroups())); //$NON-NLS-1$
        }
      } else if(currentNode.getType() == NodeConstants.Types.JOIN) {
        //pushing below a join is not necessary under an access node
        if (this.createdNodes == null && NodeEditor.findParent(currentNode, NodeConstants.Types.ACCESS) != null) {
          return currentNode;
View Full Code Here

      QueryPlannerException, QueryMetadataException {
    ProcessorPlan result;
    try {
      command = QueryRewriter.rewrite(command, metadata, context);
    } catch (TeiidProcessingException e) {
      throw new QueryPlannerException(e, e.getMessage());
    }
    result = PROCEDURE_PLANNER.optimize(command, idGenerator, metadata, capFinder, analysisRecord, context);
    return result;
  }
View Full Code Here

TOP

Related Classes of org.teiid.api.exception.query.QueryPlannerException

Copyright © 2018 www.massapicom. 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.