@Override
  public void visit(Select obj) {
    visitNodes(obj.getFrom());
    visitNodes(obj.getDerivedColumns());
    visitNode(obj.getWhere());
    visitNode(obj.getGroupBy());
    visitNode(obj.getHaving());
    visitNode(obj.getOrderBy());
    visitNode(obj.getLimit());

    if (this.doScanEvaluation) {
      HashMap<String, String> options =
          buildTableMetadata(
              this.scanTable.getName(), this.scanTable.getColumns(), this.ef.getEncoding());
      options.put(EvaluatorIterator.QUERYSTRING, SQLStringVisitor.getSQLString(obj.getWhere()));
      IteratorSetting it = new IteratorSetting(1, EvaluatorIterator.class, options);
      this.scanIterators.add(it);
    }

    if (this.selectColumns.size() < this.scanTable.getColumns().size()) {
      HashMap<String, String> options =
          buildTableMetadata(this.scanTable.getName(), this.selectColumns, this.ef.getEncoding());
      IteratorSetting it =
          new IteratorSetting(iteratorPriority++, LimitProjectionIterator.class, options);
      this.scanIterators.add(it);
    }
  }
示例#2
0
 public static List<Object> performSearch(
     Select command, String cacheName, InfinispanConnection conn) throws TranslatorException {
   return performSearch(command.getWhere(), command.getOrderBy(), cacheName, conn);
 }