Package org.openx.data.jsonserde.objectinspector.primitive

Examples of org.openx.data.jsonserde.objectinspector.primitive.JavaStringFloatObjectInspector


       
        StructObjectInspector soi = (StructObjectInspector)instance.getObjectInspector();
       
        assertEquals(Boolean.TRUE, soi.getStructFieldData(result, soi.getStructFieldRef("one")));
       
        JavaStringFloatObjectInspector jsfOi = (JavaStringFloatObjectInspector) soi.getStructFieldRef("two").getFieldObjectInspector();
        assertTrue(19.5 == jsfOi.get(soi.getStructFieldData(result, soi.getStructFieldRef("two"))));
       
        Object ar = soi.getStructFieldData(result, soi.getStructFieldRef("three"));
        assertTrue(ar instanceof JSONArray);
       
        JSONArray jar = (JSONArray)ar;
View Full Code Here


        JavaStringLongObjectInspector bioi = (JavaStringLongObjectInspector) sf.getFieldObjectInspector();
  assertEquals(123446767687867L , bioi.get(result.get("cbigint")));

  sf = soi.getStructFieldRef("cfloat");
  assertTrue(sf.getFieldObjectInspector() instanceof JavaStringFloatObjectInspector);
        JavaStringFloatObjectInspector foi = (JavaStringFloatObjectInspector) sf.getFieldObjectInspector();
  assertEquals(3.1415 , foi.get(result.get("cfloat")),0.001);
 
  sf = soi.getStructFieldRef("cdouble");
  assertTrue(sf.getFieldObjectInspector() instanceof JavaStringDoubleObjectInspector);
        JavaStringDoubleObjectInspector doi = (JavaStringDoubleObjectInspector) sf.getFieldObjectInspector();
  assertEquals(43424234234.4243423 , doi.get(result.get("cdouble")),0.001);
View Full Code Here

        JavaStringLongObjectInspector bioi = (JavaStringLongObjectInspector) sf.getFieldObjectInspector();
  assertEquals(-123446767687867L , bioi.get(result.get("cbigint")));

  sf = soi.getStructFieldRef("cfloat");
  assertTrue(sf.getFieldObjectInspector() instanceof JavaStringFloatObjectInspector);
        JavaStringFloatObjectInspector foi = (JavaStringFloatObjectInspector) sf.getFieldObjectInspector();
  assertEquals(-3.1415 , foi.get(result.get("cfloat")),0.001);
 
  sf = soi.getStructFieldRef("cdouble");
  assertTrue(sf.getFieldObjectInspector() instanceof JavaStringDoubleObjectInspector);
        JavaStringDoubleObjectInspector doi = (JavaStringDoubleObjectInspector) sf.getFieldObjectInspector();
  assertEquals(-43424234234.4243423 , doi.get(result.get("cdouble")),0.001);
View Full Code Here

 
  JSONObject result = (JSONObject) serde.deserialize(line);
 
        StructField sf = soi.getStructFieldRef("cfloat");
  assertTrue(sf.getFieldObjectInspector() instanceof JavaStringFloatObjectInspector);
        JavaStringFloatObjectInspector foi = (JavaStringFloatObjectInspector) sf.getFieldObjectInspector();
  assertEquals(3.1415E02 , foi.get(result.get("cfloat")),0.001);
 
  sf = soi.getStructFieldRef("cdouble");
  assertTrue(sf.getFieldObjectInspector() instanceof JavaStringDoubleObjectInspector);
        JavaStringDoubleObjectInspector doi = (JavaStringDoubleObjectInspector) sf.getFieldObjectInspector();
  assertEquals(-1.65788E-12 , doi.get(result.get("cdouble")),0.001);
View Full Code Here

TOP

Related Classes of org.openx.data.jsonserde.objectinspector.primitive.JavaStringFloatObjectInspector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.