org.apache.hadoop.zebra.schema
Enum ColumnType

java.lang.Object
  extended by java.lang.Enum<ColumnType>
      extended by org.apache.hadoop.zebra.schema.ColumnType
All Implemented Interfaces:
Serializable, Comparable<ColumnType>

public enum ColumnType
extends Enum<ColumnType>

Zebra Column Type


Enum Constant Summary
ANY
          Any type
BOOL
          Boolean
BYTES
          Bytes
COLLECTION
          Collection
DOUBLE
          Double
FLOAT
          Float
INT
          Integer
LONG
          Long
MAP
          Map
RECORD
          Record
STRING
          String
 
Method Summary
static String findTypeName(ColumnType columntype)
          Get the Zebra type name for the passed in Zebra column type
 String getName()
          Get the Zebra type name for this Zebra column type
static ColumnType getTypeByName(String name)
          To get the type based on the type name string.
static ColumnType getTypeByPigDataType(byte dt)
          Get the Zebra type from a Pig type
static boolean isSchemaType(ColumnType columnType)
          check if a column type contains internal schema
abstract  byte pigDataType()
           
 String toString()
          Same as getType
static ColumnType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ColumnType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ANY

public static final ColumnType ANY
Any type


INT

public static final ColumnType INT
Integer


LONG

public static final ColumnType LONG
Long


FLOAT

public static final ColumnType FLOAT
Float


DOUBLE

public static final ColumnType DOUBLE
Double


BOOL

public static final ColumnType BOOL
Boolean


COLLECTION

public static final ColumnType COLLECTION
Collection


MAP

public static final ColumnType MAP
Map


RECORD

public static final ColumnType RECORD
Record


STRING

public static final ColumnType STRING
String


BYTES

public static final ColumnType BYTES
Bytes

Method Detail

values

public static ColumnType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ColumnType c : ColumnType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ColumnType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

pigDataType

public abstract byte pigDataType()

getTypeByName

public static ColumnType getTypeByName(String name)
To get the type based on the type name string.

Parameters:
name - name of the type
Returns:
ColumnType Enum for the type

getTypeByPigDataType

public static ColumnType getTypeByPigDataType(byte dt)
Get the Zebra type from a Pig type

Parameters:
dt - Pig type
Returns:
Zebra type

findTypeName

public static String findTypeName(ColumnType columntype)
Get the Zebra type name for the passed in Zebra column type

Parameters:
columntype - Zebra column type
Returns:
string representation of the Zebra column type

getName

public String getName()
Get the Zebra type name for this Zebra column type

Returns:
string representation of the Zebra column type

toString

public String toString()
Same as getType

Overrides:
toString in class Enum<ColumnType>

isSchemaType

public static boolean isSchemaType(ColumnType columnType)
check if a column type contains internal schema

Parameters:
columnType - Zebra column type
Returns:
true if the type is RECORD, MAP or COLLECTION


Copyright © 2007-2012 The Apache Software Foundation