Examples of Limit


Examples of org.teiid.query.sql.lang.Limit

        if (rsInfo.getUserRowLimit() != -1) {
            int limit = rsInfo.getUserRowLimit();
            if (rsInfo.exceptionOnRowlimit()) {
                limit++;
            }
            rsQuery.setLimit(new Limit(null, new Constant(new Integer(limit))));
        }
       
        //prepareQuery(sourceNode, planEnv, rsQuery);
       
        // this query is not eligible for staging; proceed normally.
View Full Code Here

Examples of org.teiid.query.sql.lang.Limit

        query.setGroupBy(null);
        Criteria having = query.getHaving();
        query.setHaving(null);
        OrderBy orderBy = query.getOrderBy();
        query.setOrderBy(null);
        Limit limit = query.getLimit();
        query.setLimit(null);
        Into into = query.getInto();
        query.setInto(null);
        Set<Expression> newSelectColumns = new HashSet<Expression>();
        for (final Iterator iterator = groupBy.getSymbols().iterator(); iterator.hasNext();) {
View Full Code Here

Examples of org.teiid.query.sql.lang.Limit

       
        Query query = queryCommand.getProjectedQuery();
       
        Into into = query.getInto();
        query.setInto(null);
        Limit limit = query.getLimit();
        query.setLimit(null);
        query.setOrderBy(null);
       
        Query top = null;
       
View Full Code Here

Examples of org.teiid.query.sql.lang.Limit

        return evaluateCriteria(criteria);
  }

  private void addImplicitLimit(SubqueryContainer<QueryCommand> container, int rowLimit) {
    if (container.getCommand().getLimit() != null) {
      Limit lim = container.getCommand().getLimit();
      if (lim.getRowLimit() instanceof Constant) {
        Constant c = (Constant)lim.getRowLimit();
        if (!c.isMultiValued() && Integer.valueOf(rowLimit).compareTo((Integer) c.getValue()) <= 0) {
          lim.setRowLimit(new Constant(rowLimit));
          if (lim.getRowLimit() == null) {
            lim.setImplicit(true);
            container.getCommand().setOrderBy(null);
          }
        }
      }
      return;
    }
    boolean addLimit = true;
    if (container.getCommand() instanceof Query) {
      Query query = (Query)container.getCommand();
      addLimit = !(query.hasAggregates() && query.getGroupBy() == null);
    }
    if (addLimit) {
      Limit lim = new Limit(null, new Constant(rowLimit));
      lim.setImplicit(true);
      container.getCommand().setLimit(lim);
    }
  }
View Full Code Here

Examples of org.teiid.query.sql.lang.Limit

        switch(cmdType) {
            case Command.TYPE_QUERY:
               
                QueryCommand queryCommand = (QueryCommand) command;
               
                Limit limit = queryCommand.getLimit();
               
                if (limit != null && limit.getRowLimit() instanceof Constant) {
                    Constant rowLimit = (Constant)limit.getRowLimit();
                    if (Integer.valueOf(0).equals(rowLimit.getValue())) {
                        return false;
                    }
                }
           
View Full Code Here

Examples of org.teiid.query.sql.lang.Limit

        Query query = new Query();
        Select select = new Select(Arrays.asList(new Object[] {new AllSymbol()}));
        From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
        query.setSelect(select);
        query.setFrom(from);
        query.setLimit(new Limit(null, new Constant(new Integer(100))));
        helpTest(query, "SELECT * FROM a LIMIT 100"); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.teiid.query.sql.lang.Limit

        Query query = new Query();
        Select select = new Select(Arrays.asList(new Object[] {new AllSymbol()}));
        From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a")))); //$NON-NLS-1$
        query.setSelect(select);
        query.setFrom(from);
        query.setLimit(new Limit(new Constant(new Integer(50)), new Constant(new Integer(100))));
        helpTest(query, "SELECT * FROM a LIMIT 50, 100"); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.teiid.query.sql.lang.Limit

         * doesn't already have a limit clause.
         */
        if (requestMsg.getRowLimit() > 0 && command instanceof QueryCommand) {
            QueryCommand query = (QueryCommand)command;
            if (query.getLimit() == null) {
                query.setLimit(new Limit(null, new Constant(new Integer(requestMsg.getRowLimit()), DataTypeManager.DefaultDataClasses.INTEGER)));
                this.addedLimit = true;
            }
        }
       
        try {
View Full Code Here

Examples of pymontecarlo.program.nistmonte.options.limit.Limit

        Element limitsRoot = root.getChild("limits");

        Set<Limit> limits = new HashSet<Limit>();

        LimitExtractor extractor;
        Limit limit;
        for (Element limitElement : limitsRoot.getChildren()) {
            extractor =
                    (LimitExtractor) ExtractorManager.getExtractor(limitElement
                            .getName());
            limit = extractor.extract(limitElement);
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.