JsonSerDe serde = getNumericSerde();
Text line = new Text("{ cboolean:true, ctinyint:0x01, csmallint:0x0a, cint:0Xabcd,cbigint:0xabcd121212, cfloat:3.1415, cdouble:43424234234.4243423}");
StructObjectInspector soi = (StructObjectInspector) serde.getObjectInspector();
JSONObject result = (JSONObject) serde.deserialize(line);
StructField sf = soi.getStructFieldRef("ctinyint");
assertTrue(sf.getFieldObjectInspector() instanceof JavaStringByteObjectInspector);
JavaStringByteObjectInspector boi = (JavaStringByteObjectInspector) sf.getFieldObjectInspector();
assertEquals(1, boi.get(result.get("ctinyint")));
sf = soi.getStructFieldRef("csmallint");
assertTrue(sf.getFieldObjectInspector() instanceof JavaStringShortObjectInspector);
JavaStringShortObjectInspector shoi = (JavaStringShortObjectInspector) sf.getFieldObjectInspector();
assertEquals(10, shoi.get(result.get("csmallint")));
sf = soi.getStructFieldRef("cint");
assertTrue(sf.getFieldObjectInspector() instanceof JavaStringIntObjectInspector);
JavaStringIntObjectInspector oi = (JavaStringIntObjectInspector) sf.getFieldObjectInspector();
assertEquals(43981, oi.get(result.get("cint")));
sf = soi.getStructFieldRef("cbigint");
assertTrue(sf.getFieldObjectInspector() instanceof JavaStringLongObjectInspector);
JavaStringLongObjectInspector bioi = (JavaStringLongObjectInspector) sf.getFieldObjectInspector();
assertEquals(737879921170L , bioi.get(result.get("cbigint")));
}