Package org.apache.hadoop.zebra.schema

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


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


    Schema ret = new Schema();
    for (String col : tschema.getColumns()) {
      org.apache.hadoop.zebra.schema.Schema.ColumnSchema columnSchema =
        tschema.getColumn(col);
      if (columnSchema != null) {
        ColumnType ct = columnSchema.getType();
        if (ct == org.apache.hadoop.zebra.schema.ColumnType.RECORD ||
            ct == org.apache.hadoop.zebra.schema.ColumnType.COLLECTION)
          ret.add(new FieldSchema(col, toPigSchema(columnSchema.getSchema()), ct.pigDataType()));
        else
          ret.add(new FieldSchema(col, ct.pigDataType()));
      } else {
        ret.add(new FieldSchema(null, null));
      }
    }
    return ret;
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

        Schema ret = new Schema();
        for (String col : tschema.getColumns()) {
            org.apache.hadoop.zebra.schema.Schema.ColumnSchema columnSchema =
                tschema.getColumn(col);
            if (columnSchema != null) {
                ColumnType ct = columnSchema.getType();
                if (ct == org.apache.hadoop.zebra.schema.ColumnType.RECORD ||
                        ct == org.apache.hadoop.zebra.schema.ColumnType.COLLECTION)
                    ret.add(new FieldSchema(col, toPigSchema(columnSchema.getSchema()), ct.pigDataType()));
                else
                    ret.add(new FieldSchema(col, ct.pigDataType()));
            } else {
                ret.add(new FieldSchema(null, null));
            }
        }
        return ret;
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.