org.apache.hive.service.cli
Enum Type

java.lang.Object
  extended by java.lang.Enum<Type>
      extended by org.apache.hive.service.cli.Type
All Implemented Interfaces:
Serializable, Comparable<Type>

public enum Type
extends Enum<Type>

Type.


Enum Constant Summary
ARRAY_TYPE
           
BIGINT_TYPE
           
BINARY_TYPE
           
BOOLEAN_TYPE
           
DATE_TYPE
           
DECIMAL_TYPE
           
DOUBLE_TYPE
           
FLOAT_TYPE
           
INT_TYPE
           
MAP_TYPE
           
NULL_TYPE
           
SMALLINT_TYPE
           
STRING_TYPE
           
STRUCT_TYPE
           
TIMESTAMP_TYPE
           
TINYINT_TYPE
           
UNION_TYPE
           
USER_DEFINED_TYPE
           
VARCHAR_TYPE
           
 
Method Summary
 Integer getColumnSize()
          The column size for this type.
 String getCreateParams()
          Parameters used in creating the type (may be null)
 Integer getDecimalDigits()
          The number of fractional digits for this type.
 String getLiteralPrefix()
          Prefix used to quote a literal of this type (may be null)
 String getLiteralSuffix()
          Suffix used to quote a literal of this type (may be null)
 String getLocalizedName()
          Localized version of type name (may be null).
 Short getMaximumScale()
          Maximum scale supported for this type
 Short getMinimumScale()
          Minimum scale supported for this type
 String getName()
           
 Short getNullable()
          Can you use NULL for this type?
 Integer getNumPrecRadix()
          Radix for this type (typically either 2 or 10) Null is returned for data types where this is not applicable.
 Integer getPrecision()
          Maximum precision for numeric types.
 Integer getScale()
          Scale for this type.
 Short getSearchable()
          Can you use WHERE based on this type?
static Type getType(String name)
           
static Type getType(TTypeId tType)
           
 Boolean isAutoIncrement()
          Can this type be used for an auto-increment value?
 Boolean isCaseSensitive()
          Is the type case sensitive?
 boolean isCollectionType()
           
 boolean isComplexType()
           
 Boolean isFixedPrecScale()
          Can this type represent money?
 boolean isNumericType()
           
 boolean isPrimitiveType()
           
 boolean isQualifiedType()
           
 Boolean isUnsignedAttribute()
          Is this type unsigned?
 int toJavaSQLType()
           
 TTypeId toTType()
           
static Type valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Type[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NULL_TYPE

public static final Type NULL_TYPE

BOOLEAN_TYPE

public static final Type BOOLEAN_TYPE

TINYINT_TYPE

public static final Type TINYINT_TYPE

SMALLINT_TYPE

public static final Type SMALLINT_TYPE

INT_TYPE

public static final Type INT_TYPE

BIGINT_TYPE

public static final Type BIGINT_TYPE

FLOAT_TYPE

public static final Type FLOAT_TYPE

DOUBLE_TYPE

public static final Type DOUBLE_TYPE

STRING_TYPE

public static final Type STRING_TYPE

VARCHAR_TYPE

public static final Type VARCHAR_TYPE

DATE_TYPE

public static final Type DATE_TYPE

TIMESTAMP_TYPE

public static final Type TIMESTAMP_TYPE

BINARY_TYPE

public static final Type BINARY_TYPE

DECIMAL_TYPE

public static final Type DECIMAL_TYPE

ARRAY_TYPE

public static final Type ARRAY_TYPE

MAP_TYPE

public static final Type MAP_TYPE

STRUCT_TYPE

public static final Type STRUCT_TYPE

UNION_TYPE

public static final Type UNION_TYPE

USER_DEFINED_TYPE

public static final Type USER_DEFINED_TYPE
Method Detail

values

public static Type[] 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 (Type c : Type.values())
    System.out.println(c);

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

valueOf

public static Type 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

isPrimitiveType

public boolean isPrimitiveType()

isQualifiedType

public boolean isQualifiedType()

isComplexType

public boolean isComplexType()

isCollectionType

public boolean isCollectionType()

getType

public static Type getType(TTypeId tType)

getType

public static Type getType(String name)

getNumPrecRadix

public Integer getNumPrecRadix()
Radix for this type (typically either 2 or 10) Null is returned for data types where this is not applicable.


getDecimalDigits

public Integer getDecimalDigits()
The number of fractional digits for this type. Null is returned for data types where this is not applicable.


getPrecision

public Integer getPrecision()
Maximum precision for numeric types. Returns null for non-numeric types.

Returns:

getScale

public Integer getScale()
Scale for this type.


getColumnSize

public Integer getColumnSize()
The column size for this type. For numeric data this is the maximum precision. For character data this is the length in characters. For datetime types this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data this is the length in bytes. Null is returned for for data types where the column size is not applicable.


isNumericType

public boolean isNumericType()

getLiteralPrefix

public String getLiteralPrefix()
Prefix used to quote a literal of this type (may be null)


getLiteralSuffix

public String getLiteralSuffix()
Suffix used to quote a literal of this type (may be null)

Returns:

getNullable

public Short getNullable()
Can you use NULL for this type?

Returns:
DatabaseMetaData.typeNoNulls - does not allow NULL values DatabaseMetaData.typeNullable - allows NULL values DatabaseMetaData.typeNullableUnknown - nullability unknown

isCaseSensitive

public Boolean isCaseSensitive()
Is the type case sensitive?

Returns:

getCreateParams

public String getCreateParams()
Parameters used in creating the type (may be null)

Returns:

getSearchable

public Short getSearchable()
Can you use WHERE based on this type?

Returns:
DatabaseMetaData.typePredNone - No support DatabaseMetaData.typePredChar - Only support with WHERE .. LIKE DatabaseMetaData.typePredBasic - Supported except for WHERE .. LIKE DatabaseMetaData.typeSearchable - Supported for all WHERE ..

isUnsignedAttribute

public Boolean isUnsignedAttribute()
Is this type unsigned?

Returns:

isFixedPrecScale

public Boolean isFixedPrecScale()
Can this type represent money?

Returns:

isAutoIncrement

public Boolean isAutoIncrement()
Can this type be used for an auto-increment value?

Returns:

getLocalizedName

public String getLocalizedName()
Localized version of type name (may be null).

Returns:

getMinimumScale

public Short getMinimumScale()
Minimum scale supported for this type

Returns:

getMaximumScale

public Short getMaximumScale()
Maximum scale supported for this type

Returns:

toTType

public TTypeId toTType()

toJavaSQLType

public int toJavaSQLType()

getName

public String getName()


Copyright © 2012 The Apache Software Foundation