org.apache.lens.lib.query
Class CSVSerde

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.AbstractSerDe
      extended by org.apache.lens.lib.query.CSVSerde
All Implemented Interfaces:
org.apache.hadoop.hive.serde2.Deserializer, org.apache.hadoop.hive.serde2.SerDe, org.apache.hadoop.hive.serde2.Serializer

public final class CSVSerde
extends org.apache.hadoop.hive.serde2.AbstractSerDe

CSVSerde uses opencsv (http://opencsv.sourceforge.net/) to serialize/deserialize columns as CSV.


Field Summary
static char DEFAULT_COLLECTION_SEPERATOR
          The default collection seperator.
static char DEFAULT_MAP_KEY_VALUE_SEPERATOR
          The default map key value seperator.
static String DEFAULT_NULL_FORMAT
          The default null format.
static char DEFAULT_STRUCT_FIELD_SEPERATOR
          The default struct field seperator.
static char DEFAULT_UNION_TAG_FIELD_SEPERATOR
          The default union tag field seperator.
 
Constructor Summary
CSVSerde()
           
 
Method Summary
 Object deserialize(org.apache.hadoop.io.Writable blob)
           
 org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector getObjectInspector()
           
 org.apache.hadoop.hive.serde2.SerDeStats getSerDeStats()
           
 Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
           
 void initialize(org.apache.hadoop.conf.Configuration conf, Properties tbl)
           
 org.apache.hadoop.io.Writable serialize(Object obj, org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector objInspector)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NULL_FORMAT

public static final String DEFAULT_NULL_FORMAT
The default null format.

See Also:
Constant Field Values

DEFAULT_COLLECTION_SEPERATOR

public static final char DEFAULT_COLLECTION_SEPERATOR
The default collection seperator.

See Also:
Constant Field Values

DEFAULT_STRUCT_FIELD_SEPERATOR

public static final char DEFAULT_STRUCT_FIELD_SEPERATOR
The default struct field seperator.

See Also:
Constant Field Values

DEFAULT_UNION_TAG_FIELD_SEPERATOR

public static final char DEFAULT_UNION_TAG_FIELD_SEPERATOR
The default union tag field seperator.

See Also:
Constant Field Values

DEFAULT_MAP_KEY_VALUE_SEPERATOR

public static final char DEFAULT_MAP_KEY_VALUE_SEPERATOR
The default map key value seperator.

See Also:
Constant Field Values
Constructor Detail

CSVSerde

public CSVSerde()
Method Detail

initialize

public void initialize(org.apache.hadoop.conf.Configuration conf,
                       Properties tbl)
                throws org.apache.hadoop.hive.serde2.SerDeException
Specified by:
initialize in interface org.apache.hadoop.hive.serde2.Deserializer
Specified by:
initialize in interface org.apache.hadoop.hive.serde2.Serializer
Specified by:
initialize in class org.apache.hadoop.hive.serde2.AbstractSerDe
Throws:
org.apache.hadoop.hive.serde2.SerDeException

serialize

public org.apache.hadoop.io.Writable serialize(Object obj,
                                               org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector objInspector)
                                        throws org.apache.hadoop.hive.serde2.SerDeException
Specified by:
serialize in interface org.apache.hadoop.hive.serde2.Serializer
Specified by:
serialize in class org.apache.hadoop.hive.serde2.AbstractSerDe
Throws:
org.apache.hadoop.hive.serde2.SerDeException

deserialize

public Object deserialize(org.apache.hadoop.io.Writable blob)
                   throws org.apache.hadoop.hive.serde2.SerDeException
Specified by:
deserialize in interface org.apache.hadoop.hive.serde2.Deserializer
Specified by:
deserialize in class org.apache.hadoop.hive.serde2.AbstractSerDe
Throws:
org.apache.hadoop.hive.serde2.SerDeException

getObjectInspector

public org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector getObjectInspector()
                                                                                 throws org.apache.hadoop.hive.serde2.SerDeException
Specified by:
getObjectInspector in interface org.apache.hadoop.hive.serde2.Deserializer
Specified by:
getObjectInspector in class org.apache.hadoop.hive.serde2.AbstractSerDe
Throws:
org.apache.hadoop.hive.serde2.SerDeException

getSerializedClass

public Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
Specified by:
getSerializedClass in interface org.apache.hadoop.hive.serde2.Serializer
Specified by:
getSerializedClass in class org.apache.hadoop.hive.serde2.AbstractSerDe

getSerDeStats

public org.apache.hadoop.hive.serde2.SerDeStats getSerDeStats()
Specified by:
getSerDeStats in interface org.apache.hadoop.hive.serde2.Deserializer
Specified by:
getSerDeStats in interface org.apache.hadoop.hive.serde2.Serializer
Specified by:
getSerDeStats in class org.apache.hadoop.hive.serde2.AbstractSerDe


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.