Package com.alibaba.wasp.plan.parser

Examples of com.alibaba.wasp.plan.parser.QueryInfo


      metaEventOperation.checkAndGetFields(table, selectItem);

      // Parse The WHERE clause
      SQLExpr where = sqlSelectQueryBlock.getWhere();
      LOG.debug("SELECT SQL:where " + where);
      QueryInfo actionInfo = parseWhereClause(table, metaEventOperation, where, sqlSelectQueryBlock.isForUpdate());
      LOG.debug("ActionInfo " + actionInfo.toString());

      // Parse The Limit clause
      SQLExpr rowCount = null;
      if (sqlSelectQueryBlock.getLimit() != null) {
        rowCount = sqlSelectQueryBlock.getLimit().getRowCount();
      }
      int limit = -1;
      if (rowCount != null) {
        limit = convertToInt(rowCount);
      }

      // Convert to QueryPlan
      if(aggregateInfo == null) {
        convertToQueryPlan(table, context, actionInfo, metaEventOperation,
            selectItem, limit);
      } else {
        actionInfo.setType(QueryInfo.QueryType.AGGREGATE);
        actionInfo.setAggregateInfo(aggregateInfo);
        convertToQueryPlan(table, context, actionInfo, metaEventOperation);
      }
    } else if (sqlSelectQuery instanceof SQLUnionQuery) {
      throw new UnsupportedException("Union clause Unsupported");
    }
View Full Code Here


      MetaEventOperation metaEventOperation, SQLExpr where, boolean forUpdate) throws IOException {
    LinkedHashMap<String, Condition> conditions = new LinkedHashMap<String, Condition>();
    LinkedHashMap<String, Condition> ranges = new LinkedHashMap<String, Condition>();
    //List<Condition> ranges = new ArrayList<Condition>(5);
    ParserUtils.parse(where, conditions, ranges);
    return new QueryInfo(null, conditions, ranges, forUpdate);
  }
View Full Code Here

          if (sqlSelectQuery instanceof SQLSelectQueryBlock) {
            SQLSelectQueryBlock sqlSelectQueryBlock = (SQLSelectQueryBlock) sqlSelectQuery;
            // Parse The WHERE clause
            SQLExpr where = sqlSelectQueryBlock.getWhere();
            LOG.debug("SELECT SQL:where " + where);
            QueryInfo queryInfo = druidParser.parseWhereClause(table,
                metaEventOperation, where, false);
            Index index = metaEventOperation.checkAndGetIndex(table,
                queryInfo.getAllConditionFieldName());
            // Get the right Index
            Assert.assertEquals(indexs[i].getIndexName(), index.getIndexName());
          }
        }
        Assert.assertTrue(true);
View Full Code Here

    fieldValue.put(index1Condition.getFieldName(), index1Condition);
    fieldValue.put(index2Condition.getFieldName(), index2Condition);

    LinkedHashMap<String, Condition> ranges = new LinkedHashMap<String, Condition>();
    ranges.put(index3Condition.getFieldName(), index3Condition);
    return new QueryInfo(QueryInfo.QueryType.SCAN, fieldValue, ranges);
  }
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.plan.parser.QueryInfo

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.