Examples of StandardConstantMapObjectInspector


Examples of org.apache.hadoop.hive.serde2.objectinspector.StandardConstantMapObjectInspector

      break;
    case MAP:
      if (oi instanceof StandardConstantMapObjectInspector) {

        // constant map projection of known length
        StandardConstantMapObjectInspector scmoi = (StandardConstantMapObjectInspector) oi;
        result += getSizeOfMap(scmoi);
      } else {
        StandardMapObjectInspector smoi = (StandardMapObjectInspector) oi;
        result += getSizeOfComplexTypes(conf, smoi.getMapKeyObjectInspector());
        result += getSizeOfComplexTypes(conf, smoi.getMapValueObjectInspector());
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.StandardConstantMapObjectInspector

      break;
    case MAP:
      if (oi instanceof StandardConstantMapObjectInspector) {

        // constant map projection of known length
        StandardConstantMapObjectInspector scmoi = (StandardConstantMapObjectInspector) oi;
        result += getSizeOfMap(scmoi);
      } else {
        StandardMapObjectInspector smoi = (StandardMapObjectInspector) oi;
        result += getSizeOfComplexTypes(conf, smoi.getMapKeyObjectInspector());
        result += getSizeOfComplexTypes(conf, smoi.getMapValueObjectInspector());
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.StandardConstantMapObjectInspector

      break;
    case MAP:
      if (oi instanceof StandardConstantMapObjectInspector) {

        // constant map projection of known length
        StandardConstantMapObjectInspector scmoi = (StandardConstantMapObjectInspector) oi;
        result += getSizeOfMap(scmoi);
      } else {
        StandardMapObjectInspector smoi = (StandardMapObjectInspector) oi;
        result += getSizeOfComplexTypes(conf, smoi.getMapKeyObjectInspector());
        result += getSizeOfComplexTypes(conf, smoi.getMapValueObjectInspector());
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.StandardConstantMapObjectInspector

    public static Map<String,String> getConfigFromConstMapInspector(ObjectInspector objInspector) throws UDFArgumentException {
      if( ! ( ObjectInspectorUtils.isConstantObjectInspector(objInspector))
          || !(objInspector instanceof StandardConstantMapObjectInspector)) {
         throw new UDFArgumentException("HBase parameters must be a constant map");
      }
      StandardConstantMapObjectInspector constMapInsp = (StandardConstantMapObjectInspector) objInspector;
      Map<?,?> uninspMap  =  constMapInsp.getWritableConstantValue();
      System.out.println( " Uninsp Map = " + uninspMap + " size is " + uninspMap.size());
      Map<String,String> configMap = new HashMap<String,String>();
      for(Object uninspKey : uninspMap.keySet()) {
        Object uninspVal = uninspMap.get( uninspKey);
        String key = ((StringObjectInspector)constMapInsp.getMapKeyObjectInspector()).getPrimitiveJavaObject(uninspKey);
        String val = ((StringObjectInspector)constMapInsp.getMapValueObjectInspector()).getPrimitiveJavaObject(uninspVal);
           
        LOG.info(" Key " + key + " VAL = " + configMap.get(key) );
        System.out.println(" Key " + key + " VAL = " + configMap.get(key) );
        configMap.put( key, val);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.