org.apache.hcatalog.data.schema
Class HCatSchema
java.lang.Object
org.apache.hcatalog.data.schema.HCatSchema
- All Implemented Interfaces:
- java.io.Serializable
public class HCatSchema
- extends java.lang.Object
- implements java.io.Serializable
HCatSchema. This class is NOT thread-safe.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
HCatSchema
public HCatSchema(java.util.List<HCatFieldSchema> fieldSchemas)
- Parameters:
fieldSchemas
- is now owned by HCatSchema. Any subsequent modifications
on fieldSchemas won't get reflected in HCatSchema. Each fieldSchema's name
in the list must be unique, otherwise throws IllegalArgumentException.
append
public void append(HCatFieldSchema hfs)
throws HCatException
- Throws:
HCatException
getFields
public java.util.List<HCatFieldSchema> getFields()
- Users are not allowed to modify the list directly, since HCatSchema
maintains internal state. Use append/remove to modify the schema.
getPosition
public java.lang.Integer getPosition(java.lang.String fieldName)
- Parameters:
fieldName
-
- Returns:
- the index of field named fieldName in Schema. If field is not
present, returns null.
get
public HCatFieldSchema get(java.lang.String fieldName)
throws HCatException
- Throws:
HCatException
getFieldNames
public java.util.List<java.lang.String> getFieldNames()
get
public HCatFieldSchema get(int position)
size
public int size()
remove
public void remove(HCatFieldSchema hcatFieldSchema)
throws HCatException
- Throws:
HCatException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object