Package org.apache.hadoop.zebra.parser

Examples of org.apache.hadoop.zebra.parser.ParseException


      if (otherfs == null) continue;
      fs = getColumn(otherfs.name);
      if (fs == null) add(otherfs);
      else {
        if (!ColumnSchema.equals(fs, otherfs))
          throw new ParseException("Different types of column " + fs.name
              + " in tables of a union");
      }
    }
  }
View Full Code Here


   */
  public static void setStorageHint(JobConf conf, String storehint) throws ParseException, IOException {
    String schema = conf.get(OUTPUT_SCHEMA);

    if (schema == null)
      throw new ParseException("Schema has not been set");

    // for sanity check purpose only
    new Partition(schema, storehint, null);

    conf.set(OUTPUT_STORAGEHINT, storehint);
View Full Code Here

   
    Schema schema = null;
    try {
      schema = new Schema(schemaStr);
    } catch (ParseException e) {
      throw new ParseException("[" + zSchema + "] " + " is not a valid schema string: " + e.getMessage());
    }

    /* validity check on storage hint*/
    if (zStorageHint == null) {
      storageHintStr = "";
    } else {
      storageHintStr = zStorageHint.toString();
    }
   
    try {
      new Partition(schemaStr, storageHintStr, null);
    } catch (ParseException e) {
      throw new ParseException("[" + zStorageHint + "] " + " is not a valid storage hint string: " + e.getMessage()  );
    } catch (IOException e) {
      throw new ParseException("[" + zStorageHint + "] " + " is not a valid storage hint string: " + e.getMessage()  );
    }
   
    conf.set(OUTPUT_SCHEMA, schemaStr);
    conf.set(OUTPUT_STORAGEHINT, storageHintStr);
   
View Full Code Here

  public static void setStorageHint(JobContext jobContext, String storehint) throws ParseException, IOException {
    Configuration conf = jobContext.getConfiguration();
    String schema = conf.get(OUTPUT_SCHEMA);

    if (schema == null)
      throw new ParseException("Schema has not been set");

    // for sanity check purpose only
    new Partition(schema, storehint, null);

    conf.set(OUTPUT_STORAGEHINT, storehint);
View Full Code Here

    Schema schema = null;
    try {
      schema = new Schema(schemaStr);
    } catch (ParseException e) {
      throw new ParseException("[" + zSchema + "] " + " is not a valid schema string: " + e.getMessage());
    }

    /* validity check on storage hint*/
    if (zStorageHint == null) {
      storageHintStr = "";
    } else {
      storageHintStr = zStorageHint.toString();
    }

    try {
      new Partition(schemaStr, storageHintStr, null);
    } catch (ParseException e) {
      throw new ParseException("[" + zStorageHint + "] " + " is not a valid storage hint string: " + e.getMessage()  );
    } catch (IOException e) {
      throw new ParseException("[" + zStorageHint + "] " + " is not a valid storage hint string: " + e.getMessage()  );
    }

    Configuration conf = jobContext.getConfiguration();
    conf.set(OUTPUT_SCHEMA, schemaStr);
    conf.set(OUTPUT_STORAGEHINT, storageHintStr);
View Full Code Here

  public static void setProjection(JobConf conf, String projection) throws ParseException {
    conf.set(INPUT_PROJ, Schema.normalize(projection));

    // virtual source_table columns require sorted table
    if (Projection.getVirtualColumnIndices(projection) != null && !getSorted(conf))
        throw new ParseException("The source_table virtual column is only availabe for sorted table unions.");
  }
View Full Code Here

    String normalizedProjectionString = Schema.normalize(projection.toString());
    try {
      schema = getSchema(conf);
      new org.apache.hadoop.zebra.types.Projection(schema, normalizedProjectionString);
    } catch (ParseException e) {
      throw new ParseException("[" + projection + "] " + "is not a valid Zebra projection string " + e.getMessage());
    } catch (IOException e) {
      throw new ParseException("[" + projection + "] " + "is not a valid Zebra projection string " + e.getMessage());
    }
   
    conf.set(INPUT_PROJ, normalizedProjectionString);

    // virtual source_table columns require sorted table
    if (Projection.getVirtualColumnIndices(projection.toString()) != null && !getSorted(conf))
      throw new ParseException("The source_table virtual column is only availabe for sorted table unions.");
 
View Full Code Here

    String normalizedProjectionString = Schema.normalize(projection.toString());
    try {
      schema = getSchema( jobContext );
      new org.apache.hadoop.zebra.types.Projection(schema, normalizedProjectionString);
    } catch (ParseException e) {
      throw new ParseException("[" + projection + "] " + "is not a valid Zebra projection string " + e.getMessage());
    } catch (IOException e) {
      throw new ParseException("[" + projection + "] " + "is not a valid Zebra projection string " + e.getMessage());
    }
   
    Configuration conf = jobContext.getConfiguration();
    conf.set(INPUT_PROJ, normalizedProjectionString);

    // virtual source_table columns require sorted table
    if (Projection.getVirtualColumnIndices(projection.toString()) != null && !getSorted( conf ))
      throw new ParseException("The source_table virtual column is only availabe for sorted table unions.");
 
View Full Code Here

  /**
   * sets the source tuple for the column group ops
   */
  public void setSource(Tuple[] tuples) throws ParseException {
    if (tuples.length < mCGs.size())
      throw new ParseException(
          "Internal Logical Error: Invalid number of column groups");
    for (int i = 0; i < tuples.length; i++) {
      CGEntry mCG = mCGs.get(i);
      if (mCG != null) {
        if (tuples[i] == null) {
View Full Code Here

            return;
        }
        if (stype != SplitType.NONE) {
          if (childName != null)
            name = name + "." + childName;
          throw new ParseException("Different Split Types Set on the same field: " + name);
        }
        stype = st;
        this.splitChild = splitChild;
        if (mSplitColumns.contains(name)) {
          if (childName != null)
            name = name + "." + childName;
          throw new ParseException("Split on "+name+" are set more than once");
        }
        mSplitColumns.add(name);
      }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.zebra.parser.ParseException

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.