Package org.apache.tajo.catalog

Examples of org.apache.tajo.catalog.Schema.addColumn()


    Schema schema = new Schema();
    for (int i = 0; i < resolvedFlags.length; i++) {
      if (resolvedFlags[i]) {
        Column col = getResolvedTargetToColumn(i);
        if (!schema.contains(col.getQualifiedName()))
        schema.addColumn(col);
      } else {
        Collection<Column> cols = getColumnRefs(i);
        for (Column col : cols) {
          if (!schema.contains(col.getQualifiedName())) {
            schema.addColumn(col);
View Full Code Here


        schema.addColumn(col);
      } else {
        Collection<Column> cols = getColumnRefs(i);
        for (Column col : cols) {
          if (!schema.contains(col.getQualifiedName())) {
            schema.addColumn(col);
          }
        }
      }
    }
    return schema;
View Full Code Here

    if(maxIndex == null) {
      return null;
    } else {
      Schema keySchema = new Schema();
      for(int i = 0 ; i < maxIndex.length ; i ++ ) {
        keySchema.addColumn(maxIndex[i].getSortKey());
      }
      Datum[] datum = new Datum[nodeList.size()];
      for(int i = 0 ; i < nodeList.size() ; i ++ ) {
        datum[i] = ((ConstEval)(nodeList.get(i).getRightExpr())).getValue();
      }
View Full Code Here

  }

  public static Schema sortSpecsToSchema(SortSpec[] sortSpecs) {
    Schema schema = new Schema();
    for (SortSpec spec : sortSpecs) {
      schema.addColumn(spec.getSortKey());
    }

    return schema;
  }
View Full Code Here

      if (t.hasAlias()) {
        name = t.getAlias();
      } else {
        name = t.getEvalTree().getName();
      }
      schema.addColumn(name, type);
    }

    return schema;
  }
View Full Code Here

  }

  @Test
  public void test() throws IOException {
    Schema schema = new Schema();
    schema.addColumn("id", Type.INT4);
    schema.addColumn("age", Type.INT8);
    schema.addColumn("description", Type.TEXT);

    TableMeta meta = CatalogUtil.newTableMeta(schema, StoreType.ROWFILE);
View Full Code Here

  @Test
  public void test() throws IOException {
    Schema schema = new Schema();
    schema.addColumn("id", Type.INT4);
    schema.addColumn("age", Type.INT8);
    schema.addColumn("description", Type.TEXT);

    TableMeta meta = CatalogUtil.newTableMeta(schema, StoreType.ROWFILE);

    AbstractStorageManager sm = StorageManagerFactory.getStorageManager(conf, new Path(conf.getVar(ConfVars.ROOT_DIR)));
View Full Code Here

  @Test
  public void test() throws IOException {
    Schema schema = new Schema();
    schema.addColumn("id", Type.INT4);
    schema.addColumn("age", Type.INT8);
    schema.addColumn("description", Type.TEXT);

    TableMeta meta = CatalogUtil.newTableMeta(schema, StoreType.ROWFILE);

    AbstractStorageManager sm = StorageManagerFactory.getStorageManager(conf, new Path(conf.getVar(ConfVars.ROOT_DIR)));
View Full Code Here

public class SchemaUtil {
  public static Schema merge(Schema left, Schema right) {
    Schema merged = new Schema();
    for(Column col : left.getColumns()) {
      if (!merged.contains(col.getQualifiedName())) {
        merged.addColumn(col);
      }
    }
    for(Column col : right.getColumns()) {
      if (!merged.contains(col.getQualifiedName())) {
        merged.addColumn(col);
View Full Code Here

        merged.addColumn(col);
      }
    }
    for(Column col : right.getColumns()) {
      if (!merged.contains(col.getQualifiedName())) {
        merged.addColumn(col);
      }
    }
   
    return merged;
  }
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.