Package org.apache.tajo.catalog

Examples of org.apache.tajo.catalog.SortSpec


  public static SortSpec[] schemaToSortSpecs(Schema schema) {
    SortSpec[] specs = new SortSpec[schema.getColumnNum()];

    for (int i = 0; i < schema.getColumnNum(); i++) {
      specs[i] = new SortSpec(schema.getColumn(i), true, false);
    }

    return specs;
  }
View Full Code Here


        DatumFactory.createInt4(25),
        DatumFactory.createInt4(109),
        DatumFactory.createInt4(4),
        DatumFactory.createText("abd")});

    SortSpec sortKey1 = new SortSpec(schema.getColumnByFQN("col4"), true, false);
    SortSpec sortKey2 = new SortSpec(schema.getColumnByFQN("col5"), true, false);

    TupleComparator tc = new TupleComparator(schema,
        new SortSpec[] {sortKey1, sortKey2});
    assertEquals(-1, tc.compare(tuple1, tuple2));
    assertEquals(1, tc.compare(tuple2, tuple1));
View Full Code Here

          SortSpec [] sortSpecs = null;
          if (sortExec != null) {
            sortSpecs = sortExec.getSortSpecs();
          } else {
            Column[] columns = ctx.getDataChannel().getPartitionKey();
            SortSpec specs[] = new SortSpec[columns.length];
            for (int i = 0; i < columns.length; i++) {
              specs[i] = new SortSpec(columns[i]);
            }
          }

          return new IndexedStoreExec(ctx, sm, subOp,
              plan.getInSchema(), plan.getInSchema(), sortSpecs);
View Full Code Here

      throws IOException {

    Column[] grpColumns = groupbyNode.getGroupingColumns();
    SortSpec[] sortSpecs = new SortSpec[grpColumns.length];
    for (int i = 0; i < grpColumns.length; i++) {
      sortSpecs[i] = new SortSpec(grpColumns[i], true, false);
    }

    if (property != null) {
      List<CatalogProtos.SortSpecProto> sortSpecProtos = property.getGroupby().getSortSpecsList();
      SortSpec[] enforcedSortSpecs = new SortSpec[sortSpecProtos.size()];
      int i = 0;

      for (int j = 0; j < sortSpecProtos.size(); i++, j++) {
        enforcedSortSpecs[i] = new SortSpec(sortSpecProtos.get(j));
      }

      sortSpecs = ObjectArrays.concat(sortSpecs, enforcedSortSpecs, SortSpec.class);
    }
View Full Code Here

  public static SortSpec[] schemaToSortSpecs(Column [] columns) {
    SortSpec[] specs = new SortSpec[columns.length];

    for (int i = 0; i < columns.length; i++) {
      specs[i] = new SortSpec(columns[i], true, false);
    }

    return specs;
  }
View Full Code Here

  public static SortSpec [] columnsToSortSpec(Collection<Column> columns) {
    SortSpec[] specs = new SortSpec[columns.size()];
    int i = 0;
    for (Column column : columns) {
      specs[i++] = new SortSpec(column, true, false);
    }

    return specs;
  }
View Full Code Here

    List<Column []> joinKeyPairs = getJoinKeyPairs(joinQual, outer, inner);
    SortSpec[] outerSortSpec = new SortSpec[joinKeyPairs.size()];
    SortSpec[] innerSortSpec = new SortSpec[joinKeyPairs.size()];

    for (int i = 0; i < joinKeyPairs.size(); i++) {
      outerSortSpec[i] = new SortSpec(joinKeyPairs.get(i)[0]);
      innerSortSpec[i] = new SortSpec(joinKeyPairs.get(i)[1]);
    }

    return new SortSpec[][] {outerSortSpec, innerSortSpec};
  }
View Full Code Here

  public static SortSpec[] schemaToSortSpecs(Column[] columns) {
    SortSpec[] specs = new SortSpec[columns.length];

    for (int i = 0; i < columns.length; i++) {
      specs[i] = new SortSpec(columns[i], true, false);
    }

    return specs;
  }
View Full Code Here

  public static SortSpec[] columnsToSortSpec(Collection<Column> columns) {
    SortSpec[] specs = new SortSpec[columns.size()];
    int i = 0;
    for (Column column : columns) {
      specs[i++] = new SortSpec(column, true, false);
    }

    return specs;
  }
View Full Code Here

    List<Column[]> joinKeyPairs = getJoinKeyPairs(joinQual, outer, inner, false);
    SortSpec[] outerSortSpec = new SortSpec[joinKeyPairs.size()];
    SortSpec[] innerSortSpec = new SortSpec[joinKeyPairs.size()];

    for (int i = 0; i < joinKeyPairs.size(); i++) {
      outerSortSpec[i] = new SortSpec(joinKeyPairs.get(i)[0]);
      innerSortSpec[i] = new SortSpec(joinKeyPairs.get(i)[1]);
    }

    return new SortSpec[][]{outerSortSpec, innerSortSpec};
  }
View Full Code Here

TOP

Related Classes of org.apache.tajo.catalog.SortSpec

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.