Package org.teiid.api.exception.query

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


            Object modelID = RuleRaiseAccess.getModelIDFromAccess(node, metadata);

            if(CapabilitiesUtil.requiresCriteria(modelID, metadata, capFinder)
                && hasNoCriteria((Command) node.getProperty(NodeConstants.Info.ATOMIC_REQUEST))) {
                String modelName = metadata.getFullName(modelID);
                throw new QueryPlannerException(QueryPlugin.Util.getString("ERR.015.004.0024", modelName)); //$NON-NLS-1$
            }
    }

    return plan;
  }
View Full Code Here


                continue;
            }
                       
            //quick check for satisfiability
            if (!joinRegion.isSatisfiable()) {
                throw new QueryPlannerException(QueryPlugin.Util.getString("RulePlanJoins.cantSatisfy", joinRegion.getUnsatisfiedAccessPatterns())); //$NON-NLS-1$
            }
                       
            planForDependencies(joinRegion);
        }
       
View Full Code Here

     * @throws QueryPlannerException
     */
    private void planForDependencies(JoinRegion joinRegion) throws QueryPlannerException {
               
        if (joinRegion.getJoinSourceNodes().isEmpty()) {
            throw new QueryPlannerException(QueryPlugin.Util.getString("RulePlanJoins.cantSatisfy", joinRegion.getUnsatisfiedAccessPatterns())); //$NON-NLS-1$
        }
       
        HashSet<GroupSymbol> currentGroups = new HashSet<GroupSymbol>();
       
        for (PlanNode joinSource : joinRegion.getJoinSourceNodes().keySet()) {
            currentGroups.addAll(joinSource.getGroups());
        }
               
        HashMap<PlanNode, PlanNode> dependentNodes = new HashMap<PlanNode, PlanNode>(joinRegion.getDependentJoinSourceNodes());
               
        boolean satisfiedAP = true;
       
        while (!dependentNodes.isEmpty() && satisfiedAP) {
           
            satisfiedAP = false;
       
            for (Iterator<Map.Entry<PlanNode, PlanNode>> joinSources = dependentNodes.entrySet().iterator(); joinSources.hasNext();) {
              Map.Entry<PlanNode, PlanNode> entry = joinSources.next();
                PlanNode joinSource = entry.getKey();
               
                Collection accessPatterns = (Collection)joinSource.getProperty(NodeConstants.Info.ACCESS_PATTERNS);
                for (Iterator i = accessPatterns.iterator(); i.hasNext();) {
                    AccessPattern ap = (AccessPattern)i.next();
                   
                    boolean foundGroups = true;
                    HashSet<GroupSymbol> allRequiredGroups = new HashSet<GroupSymbol>();
                    for (ElementSymbol symbol : ap.getUnsatisfied()) {
                        Set<Collection<GroupSymbol>> requiredGroupsSet = joinRegion.getDependentCriteriaElements().get(symbol);
                        boolean elementSatisfied = false;
                        if (requiredGroupsSet != null) {
                            for (Collection<GroupSymbol> requiredGroups : requiredGroupsSet) {
                                if (currentGroups.containsAll(requiredGroups)) {
                                    elementSatisfied = true;
                                    allRequiredGroups.addAll(requiredGroups);
                                    break;
                                }
                            }
                        }
                        if (!elementSatisfied) {
                            foundGroups = false;
                            break;
                        }
                    }
                   
                    if (!foundGroups) {
                        continue;
                    }
                   
                    joinSources.remove();
                    satisfiedAP = true;
                    joinSource.setProperty(NodeConstants.Info.ACCESS_PATTERN_USED, ap.clone());
                    joinSource.setProperty(NodeConstants.Info.REQUIRED_ACCESS_PATTERN_GROUPS, allRequiredGroups);
                    break;
                }
            }
        }
       
        if (!dependentNodes.isEmpty()) {
            throw new QueryPlannerException(QueryPlugin.Util.getString("RulePlanJoins.cantSatisfy", joinRegion.getUnsatisfiedAccessPatterns())); //$NON-NLS-1$
        }
       
    }
View Full Code Here

        }
        // Simplify criteria if possible
        try {
            return QueryRewriter.rewriteCriteria(criteria, null, null, metadata);
        } catch(TeiidProcessingException e) {
            throw new QueryPlannerException(e, QueryPlugin.Util.getString("ERR.015.004.0023", criteria)); //$NON-NLS-1$
        } catch (TeiidComponentException e) {
          throw new TeiidRuntimeException(e);
        }
    }
View Full Code Here

                }*/
               
                defaults.add(defaultValue);
               
                if (defaultValue == null && !coveredParams.contains(symbol)) {
                    throw new QueryPlannerException(QueryPlugin.Util.getString("RulePlanProcedures.no_values", symbol)); //$NON-NLS-1$
                }
            }
           
            /*if (conjuncts.isEmpty()) {
                for (int j = 0; j < inputReferences.size(); j++) {
View Full Code Here

   
    if (node instanceof AccessNode) {
      try {
        return multiSourceModify((AccessNode)node);
      } catch (TeiidProcessingException e) {
        throw new QueryPlannerException(e, e.getMessage());
      }
    } else if (node instanceof ProjectIntoNode) {
      throw new AssertionError("Multisource insert with query expression not allowed not allowed, should have been caught in validation."); //$NON-NLS-1$
    }
   
View Full Code Here

                               
            accessNodes.add(instanceNode);
        }
       
        if (hasOutParams && accessNodes.size() != 1) {
          throw new QueryPlannerException(QueryPlugin.Util.getString("MultiSource.out_procedure", accessNode.getCommand())); //$NON-NLS-1$
        }

        switch(accessNodes.size()) {
            case 0:
            {
View Full Code Here

                }
            }
        }
       
        Object groups = node.getGroups();
        throw new QueryPlannerException(QueryPlugin.Util.getString("ERR.015.004.0012", new Object[] {groups, accessPatterns})); //$NON-NLS-1$
    }
View Full Code Here

            case NodeConstants.Types.NULL:
                processNode = new NullNode(getID());
                break;

      default:
                throw new QueryPlannerException(QueryPlugin.Util.getString("ERR.015.004.0007", NodeConstants.getNodeTypeString(node.getType()))); //$NON-NLS-1$
    }

    if(processNode != null) {
      processNode = prepareToAdd(node, processNode);
    }
View Full Code Here

        }
      }
      String cbName = metadata.getFullName(modelID);
      return cbName;
    } catch(QueryMetadataException e) {
            throw new QueryPlannerException(e, QueryPlugin.Util.getString("ERR.015.004.0009")); //$NON-NLS-1$
    }
  }
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.