org.apache.hcatalog.data
Class JsonSerDe
Object
   JsonSerDe
JsonSerDe
- All Implemented Interfaces: 
- Deserializer, SerDe, Serializer
- public class JsonSerDe 
- extends Object- implements SerDe
 
| Method Summary | 
|  Object | deserialize(Writable blob)Takes JSON string in Text form, and has to return an object representation above
 it that's readable by the corresponding object inspector.
 | 
|  String | getHiveInternalColumnName(int fpos)
 | 
|  ObjectInspector | getObjectInspector()Returns an object inspector for the specified schema that
  is capable of reading in the object representation of the JSON string
 | 
|  int | getPositionFromHiveInternalColumnName(String internalName)
 | 
|  SerDeStats | getSerDeStats()
 | 
|  Class<? extends Writable> | getSerializedClass()
 | 
|  void | initialize(Configuration conf,
           Properties tbl)
 | 
|  Writable | serialize(Object obj,
          ObjectInspector objInspector)Given an object and object inspector pair, traverse the object
 and generate a Text representation of the object.
 | 
 
| Methods inherited from class Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
JsonSerDe
public JsonSerDe()
initialize
public void initialize(Configuration conf,
                       Properties tbl)
                throws SerDeException
- 
- Specified by:
- initializein interface- Deserializer
- Specified by:
- initializein interface- Serializer
 
- 
- Throws:
- SerDeException
 
deserialize
public Object deserialize(Writable blob)
                   throws SerDeException
- Takes JSON string in Text form, and has to return an object representation above
 it that's readable by the corresponding object inspector.
 For this implementation, since we're using the jackson parser, we can construct
 our own object implementation, and we use HCatRecord for it
 
- 
- Specified by:
- deserializein interface- Deserializer
 
- 
- Throws:
- SerDeException
 
getHiveInternalColumnName
public String getHiveInternalColumnName(int fpos)
- 
 
- 
 
getPositionFromHiveInternalColumnName
public int getPositionFromHiveInternalColumnName(String internalName)
- 
 
- 
 
serialize
public Writable serialize(Object obj,
                          ObjectInspector objInspector)
                   throws SerDeException
- Given an object and object inspector pair, traverse the object
 and generate a Text representation of the object.
 
- 
- Specified by:
- serializein interface- Serializer
 
- 
- Throws:
- SerDeException
 
getObjectInspector
public ObjectInspector getObjectInspector()
                                   throws SerDeException
- Returns an object inspector for the specified schema that
  is capable of reading in the object representation of the JSON string
 
- 
- Specified by:
- getObjectInspectorin interface- Deserializer
 
- 
- Throws:
- SerDeException
 
getSerializedClass
public Class<? extends Writable> getSerializedClass()
- 
- Specified by:
- getSerializedClassin interface- Serializer
 
- 
 
getSerDeStats
public SerDeStats getSerDeStats()
- 
- Specified by:
- getSerDeStatsin interface- Deserializer
- Specified by:
- getSerDeStatsin interface- Serializer
 
-