Package org.apache.hadoop.zebra.schema

Examples of org.apache.hadoop.zebra.schema.ColumnType


        org.apache.hadoop.zebra.schema.Schema schema = new org.apache.hadoop.zebra.schema.Schema();
        ResourceSchema.ResourceFieldSchema[] fields = rSchema.getFields();
        for( ResourceSchema.ResourceFieldSchema field : fields ) {
            String name = field.getName();
            ColumnType type = toTableType( field.getType() );
            org.apache.hadoop.zebra.schema.Schema cSchema = convertFromResourceSchema( field.getSchema() );
            if( type == ColumnType.MAP && cSchema == null ) {
                cSchema = new org.apache.hadoop.zebra.schema.Schema();
                cSchema.add( new org.apache.hadoop.zebra.schema.Schema.ColumnSchema( "", ColumnType.BYTES ) );
            }
View Full Code Here


          pn.setDT(ColumnType.MAP);
        if (fs == null)
             continue; // skip non-existing field
   
        j = fs.getIndex();
        ColumnType ct = pn.getDT();
        if (ct == ColumnType.MAP || ct == ColumnType.RECORD || ct == ColumnType.COLLECTION)
        {
          // record/map subfield is expected
          sc = new SplitColumn(j, ct);
          if (ct == ColumnType.MAP)
View Full Code Here

     */
    private void buildSplit(SplitColumn parent, Schema.ColumnSchema fs,
        final Schema.ParsedName pn, final int projIndex, HashSet<String> keys) throws ParseException, ExecException
    {
      // recursive call to get the next level schema
      ColumnType ct = pn.getDT();
      if (ct != fs.getType())
          throw new ParseException(fs.getName()+" is not of proper type.");
 
      String prefix;
      int fieldIndex;
View Full Code Here

  }

  final public Schema.ColumnSchema AnonymousRecordSchema(Schema.ColumnSchema schema, String name, int cl, int colIndex) throws ParseException, ParseException {
        Schema.ColumnSchema fs = null, fs0 = null;
        Token t;
  ColumnType ct;
        if (schema == null)
        {
                String msg = "no matching column: " + name;
                throw new ParseException(msg);
        } else if ((ct = schema.getType()) != ColumnType.RECORD && ct != ColumnType.COLLECTION) {
View Full Code Here

                                        objout.close();
                                        System.out.println(schema.toString());
      }

  final public ColumnType Type() throws ParseException {
        ColumnType type;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case INT:
    case BOOL:
    case LONG:
    case FLOAT:
View Full Code Here

    throw new Error("Missing return statement in function");
  }

  final public ColumnType CompositeType() throws ParseException {
        Token t = null;
        ColumnType type;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case MAP:
      t = jj_consume_token(MAP);
      break;
    case COLLECTION:
View Full Code Here

    throw new Error("Missing return statement in function");
  }

  final public ColumnType BasicType() throws ParseException {
        Token t = null;
        ColumnType type;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case INT:
      t = jj_consume_token(INT);
      break;
    case LONG:
View Full Code Here

    throw new Error("Missing return statement in function");
  }

  final public Schema.ColumnSchema AtomSchema() throws ParseException, ParseException {
        Token t1 = null;
        ColumnType type = ColumnType.BYTES;
        Schema.ColumnSchema fs;
    t1 = jj_consume_token(IDENTIFIER);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 22:
      jj_consume_token(22);
View Full Code Here

                {if (true) return fs;}
    throw new Error("Missing return statement in function");
  }

  final public Schema.ColumnSchema AnonymousAtomSchema() throws ParseException, ParseException {
        ColumnType type = ColumnType.BYTES;
        Schema.ColumnSchema fs;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case INT:
    case BOOL:
    case LONG:
View Full Code Here

import org.apache.pig.impl.logicalLayer.schema.Schema;
import org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema;

class SchemaConverter {
    public static ColumnType toTableType(byte ptype) {
        ColumnType ret;
        switch (ptype) {
        case DataType.INTEGER:
            ret = ColumnType.INT;
            break;
        case DataType.LONG:
View Full Code Here

TOP

Related Classes of org.apache.hadoop.zebra.schema.ColumnType

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.