Package org.apache.hadoop.zebra.types

Examples of org.apache.hadoop.zebra.types.Projection


     *          operations. If we want select all columns, pass
     *          projection==null.
     */
    public synchronized void setProjection(String projection) throws ParseException {
      if (projection == null) {
        this.projection = new Projection(cgschema.getSchema());
      }
      else {
        this.projection = new Projection(cgschema.getSchema(), projection);
      }
    }
View Full Code Here


  @Override
  public Schema determineSchema(String fileName, ExecType execType,
      DataStorage storage) throws IOException {
    checkConf(storage, fileName);

    Projection projection;
    org.apache.hadoop.zebra.types.Schema projectionSchema;
   
    if (!fileName.contains(",")) { // one table;
      org.apache.hadoop.zebra.types.Schema tschema = BasicTable.Reader.getSchema(new Path(fileName), jobConf);
      try {
        projection = new org.apache.hadoop.zebra.types.Projection(tschema, TableInputFormat.getProjection(jobConf));
        projectionSchema = projection.getProjectionSchema();
      } catch (ParseException e) {
        throw new IOException("Schema parsing failed : "+e.getMessage());
      }
    } else { // table union;
      org.apache.hadoop.zebra.types.Schema unionSchema = new org.apache.hadoop.zebra.types.Schema();
      for (Path p : paths) {
        org.apache.hadoop.zebra.types.Schema schema = BasicTable.Reader.getSchema(p, jobConf);
        try {
          unionSchema.unionSchema(schema);
        } catch (ParseException e) {
          throw new IOException(e.getMessage());
        }
      }
     
      try {
        projection = new org.apache.hadoop.zebra.types.Projection(unionSchema, TableInputFormat.getProjection(jobConf));
        projectionSchema = projection.getProjectionSchema();
      } catch (ParseException e) {
        throw new IOException("Schema parsing failed : "+e.getMessage());
      }
    }   
   
View Full Code Here

        Schema schema;
        colGroups = new ColumnGroup.Reader[numCGs];
        cgTuples = new Tuple[numCGs];
        // set default projection that contains everything
        schema = schemaFile.getLogical();
        projection = new Projection(schema);
        String storage = schemaFile.getStorageString();
        partition = new Partition(schema, projection, storage);
        for (int nx = 0; nx < numCGs; nx++) {
          colGroups[nx] =
              new ColumnGroup.Reader(BasicTable.makeCGPath(path, numCGs, nx),
View Full Code Here

     * @throws IOException
     */
    public synchronized void setProjection(String projection)
        throws ParseException, IOException {
      if (projection == null) {
        this.projection = new Projection(schemaFile.getLogical());
        partition =
            new Partition(schemaFile.getLogical(), this.projection, schemaFile
                .getStorageString());
      }
      else {
        /**
         * the typed schema from projection which is untyped or actually typed
         * as "bytes"
         */
        this.projection =
            new Projection(schemaFile.getLogical(), projection);
        partition =
            new Partition(schemaFile.getLogical(), this.projection, schemaFile
                .getStorageString());
      }
      inferredMapping = false;
View Full Code Here

      cgschema = CGSchema.load(fs, path);
      if (cgschema.isSorted()) {
        comparator = TFile.makeComparator(cgschema.getComparator());
      }
      projection = new Projection(cgschema.getSchema()); // default projection to CG schema.
      Path metaFilePath = makeMetaFilePath(path);
      if (!fs.exists(metaFilePath)) {
        // special case for unsorted CG that did not create index properly.
        if (cgschema.isSorted()) {
          throw new FileNotFoundException(
View Full Code Here

     *          operations. If we want select all columns, pass
     *          projection==null.
     */
    public synchronized void setProjection(String projection) throws ParseException {
      if (projection == null) {
        this.projection = new Projection(cgschema.getSchema());
      }
      else {
        this.projection = new Projection(cgschema.getSchema(), projection);
      }
    }
View Full Code Here

      cgschema = CGSchema.load(fs, path);
      if (cgschema.isSorted()) {
        comparator = TFile.makeComparator(cgschema.getComparator());
      }
      projection = new Projection(cgschema.getSchema()); // default projection to CG schema.
      Path metaFilePath = makeMetaFilePath(path);
      /* If index file is not existing */
      if (!fs.exists(metaFilePath)) {
        throw new FileNotFoundException(
              "Missing Meta File of " + metaFilePath);
View Full Code Here

     *          operations. If we want select all columns, pass
     *          projection==null.
     */
    public synchronized void setProjection(String projection) throws ParseException {
      if (projection == null) {
        this.projection = new Projection(cgschema.getSchema());
      }
      else {
        this.projection = new Projection(cgschema.getSchema(), projection);
      }
    }
View Full Code Here

        Schema schema;
        colGroups = new ColumnGroup.Reader[numCGs];
        cgTuples = new Tuple[numCGs];
        // set default projection that contains everything
        schema = schemaFile.getLogical();
        projection = new Projection(schema);
        String storage = schemaFile.getStorageString();
        String comparator = schemaFile.getComparator();
        partition = new Partition(schema, projection, storage, comparator);
        for (int nx = 0; nx < numCGs; nx++) {
          if (!schemaFile.isCGDeleted(nx)) {
View Full Code Here

     * @throws IOException
     */
    public synchronized void setProjection(String projection)
        throws ParseException, IOException {
      if (projection == null) {
        this.projection = new Projection(schemaFile.getLogical());
        partition =
            new Partition(schemaFile.getLogical(), this.projection, schemaFile
                .getStorageString(), schemaFile.getComparator());
      }
      else {
        /**
         * the typed schema from projection which is untyped or actually typed
         * as "bytes"
         */
        this.projection =
            new Projection(schemaFile.getLogical(), projection);
        partition =
            new Partition(schemaFile.getLogical(), this.projection, schemaFile
                .getStorageString(), schemaFile.getComparator());
      }
      inferredMapping = false;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.zebra.types.Projection

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.