Examples of MapJoinObjectValue


Examples of org.apache.hadoop.hive.ql.exec.persistence.MapJoinObjectValue

      storage.get((byte) tag).add(value);

      for (Byte pos : order) {
        if (pos.intValue() != tag) {

          MapJoinObjectValue o = mapJoinTables.get(pos).get(key);
          MapJoinRowContainer<ArrayList<Object>> rowContainer = rowContainerMap.get(pos);

          // there is no join-value or join-key has all null elements
          if (o == null || key.hasAnyNulls()) {
            if (noOuterJoin) {
              storage.put(pos, emptyList);
            } else {
              storage.put(pos, dummyObjVectors[pos.intValue()]);
            }
          } else {
            rowContainer.reset(o.getObj());
            storage.put(pos, rowContainer);
          }
        }
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.exec.persistence.MapJoinObjectValue

      storage.get((byte) tag).add(value);

      for (Byte pos : order) {
        if (pos.intValue() != tag) {

          MapJoinObjectValue o = mapJoinTables.get(pos).get(key);
          MapJoinRowContainer<ArrayList<Object>> rowContainer = rowContainerMap.get(pos);

          // there is no join-value or join-key has all null elements
          if (o == null || key.hasAnyNulls()) {
            if (noOuterJoin) {
              storage.put(pos, emptyList);
            } else {
              storage.put(pos, dummyObjVectors[pos.intValue()]);
            }
          } else {
            rowContainer.reset(o.getObj());
            storage.put(pos, rowContainer);
          }
        }
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.exec.persistence.MapJoinObjectValue

        }
         

        HashMapWrapper<MapJoinObjectKey, MapJoinObjectValue> hashTable =  mapJoinTables.get(alias);
        MapJoinObjectKey keyMap = new MapJoinObjectKey(metadataKeyTag, key);
        MapJoinObjectValue o = hashTable.get(keyMap);
        RowContainer res = null;

        boolean needNewKey = true;
        if (o == null) {
          int bucketSize = HiveConf.getIntVar(hconf, HiveConf.ConfVars.HIVEMAPJOINBUCKETCACHESIZE);
          res = new RowContainer(bucketSize);
          res.add(value);
        } else {
          res = o.getObj();
          res.add(value);
          // If key already exists, HashMapWrapper.get() guarantees it is already in main memory HashMap
          // cache. So just replacing the object value should update the HashMapWrapper. This will save
          // the cost of constructing the new key/object and deleting old one and inserting the new one.
          if ( hashTable.cacheSize() > 0) {
            o.setObj(res);
            needNewKey = false;
          }
        }
       
       
        if (metadataValueTag[tag] == -1) {
          metadataValueTag[tag] = nextVal++;
         
          tableDesc valueTableDesc = conf.getValueTblDescs().get(tag);
          SerDe valueSerDe = (SerDe)ReflectionUtils.newInstance(valueTableDesc.getDeserializerClass(), null);
          valueSerDe.initialize(null, valueTableDesc.getProperties());
         
          mapMetadata.put(Integer.valueOf(metadataValueTag[tag]),
                          new MapJoinObjectCtx(
                                ObjectInspectorUtils.getStandardObjectInspector(valueSerDe.getObjectInspector(),
                                  ObjectInspectorCopyOption.WRITABLE),
                                valueSerDe, valueTableDesc, hconf));
        }
       
        // Construct externalizable objects for key and value
        if ( needNewKey ) {
          MapJoinObjectKey keyObj = new MapJoinObjectKey(metadataKeyTag, key);
          MapJoinObjectValue valueObj = new MapJoinObjectValue(metadataValueTag[tag], res);
          valueObj.setConf(hconf);
         
          // This may potentially increase the size of the hashmap on the mapper
          if (res.size() > mapJoinRowsKey) {
            if ( res.size() % 100 == 0 ) {
              LOG.warn("Number of values for a given key " + keyObj + " are " + res.size());
              LOG.warn("used memory " + Runtime.getRuntime().totalMemory());
            }
          }
          hashTable.put(keyObj, valueObj);
        }
        return;
      }

      // Add the value to the ArrayList
      storage.get(alias).add(value);

      for (Byte pos : order) {
        if (pos.intValue() != tag) {
          MapJoinObjectKey keyMap = new MapJoinObjectKey(metadataKeyTag, key);
          MapJoinObjectValue o = (MapJoinObjectValue)mapJoinTables.get(pos).get(keyMap);

          if (o == null) {
            storage.put(pos, dummyObjVectors[pos.intValue()]);
          }
          else {
            storage.put(pos, o.getObj());
          }
        }
      }

      // generate the output records
View Full Code Here

Examples of org.apache.hadoop.hive.ql.exec.persistence.MapJoinObjectValue

      storage.get((byte) tag).add(value);

      for (Byte pos : order) {
        if (pos.intValue() != tag) {

          MapJoinObjectValue o = mapJoinTables.get(pos).get(key);
          MapJoinRowContainer<ArrayList<Object>> rowContainer = rowContainerMap.get(pos);

          // there is no join-value or join-key has all null elements
          if (o == null || key.hasAnyNulls(nullsafes)) {
            if (noOuterJoin) {
              storage.put(pos, emptyList);
            } else {
              storage.put(pos, dummyObjVectors[pos.intValue()]);
            }
          } else {
            rowContainer.reset(o.getObj());
            storage.put(pos, rowContainer);
          }
        }
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.exec.persistence.MapJoinObjectValue


      HashMapWrapper<AbstractMapJoinKey, MapJoinObjectValue> hashTable = mapJoinTables
          .get((byte) tag);

      MapJoinObjectValue o = hashTable.get(keyMap);
      MapJoinRowContainer<Object[]> res = null;

      boolean needNewKey = true;
      if (o == null) {
        res = new MapJoinRowContainer<Object[]>();
        res.add(value);

        if (metadataValueTag[tag] == -1) {
          metadataValueTag[tag] = order[tag];
          setValueMetaData(tag);
        }

        // Construct externalizable objects for key and value
        if (needNewKey) {
          MapJoinObjectValue valueObj = new MapJoinObjectValue(metadataValueTag[tag], res);

          rowNumber++;
          if (rowNumber > hashTableScale && rowNumber % hashTableScale == 0) {
            isAbort = hashTable.isAbort(rowNumber, console);
            if (isAbort) {
View Full Code Here

Examples of org.apache.hadoop.hive.ql.exec.persistence.MapJoinObjectValue

      storage.get((byte) tag).add(value);

      for (Byte pos : order) {
        if (pos.intValue() != tag) {

          MapJoinObjectValue o = mapJoinTables.get(pos).get(key);
          MapJoinRowContainer<ArrayList<Object>> rowContainer = rowContainerMap.get(pos);

          // there is no join-value or join-key has all null elements
          if (o == null || key.hasAnyNulls()) {
            if (noOuterJoin) {
              storage.put(pos, emptyList);
            } else {
              storage.put(pos, dummyObjVectors[pos.intValue()]);
            }
          } else {
            rowContainer.reset(o.getObj());
            storage.put(pos, rowContainer);
          }
        }
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.exec.persistence.MapJoinObjectValue

      storage.get((byte) tag).add(value);

      for (Byte pos : order) {
        if (pos.intValue() != tag) {

          MapJoinObjectValue o = mapJoinTables.get(pos).get(key);
          MapJoinRowContainer<ArrayList<Object>> rowContainer = rowContainerMap.get(pos);

          // there is no join-value or join-key has all null elements
          if (o == null || key.hasAnyNulls(nullsafes)) {
            if (noOuterJoin) {
              storage.put(pos, emptyList);
            } else {
              storage.put(pos, dummyObjVectors[pos.intValue()]);
            }
          } else {
            rowContainer.reset(o.getObj());
            storage.put(pos, rowContainer);
          }
        }
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.exec.persistence.MapJoinObjectValue


      HashMapWrapper<AbstractMapJoinKey, MapJoinObjectValue> hashTable = mapJoinTables
          .get((byte) tag);

      MapJoinObjectValue o = hashTable.get(keyMap);
      MapJoinRowContainer<Object[]> res = null;

      boolean needNewKey = true;
      if (o == null) {
        res = new MapJoinRowContainer<Object[]>();
        res.add(value);

        if (metadataValueTag[tag] == -1) {
          metadataValueTag[tag] = order[tag];
          setValueMetaData(tag);
        }

        // Construct externalizable objects for key and value
        if (needNewKey) {
          MapJoinObjectValue valueObj = new MapJoinObjectValue(metadataValueTag[tag], res);

          rowNumber++;
          if (rowNumber > hashTableScale && rowNumber % hashTableScale == 0) {
            isAbort = hashTable.isAbort(rowNumber, console);
            if (isAbort) {
View Full Code Here

Examples of org.apache.hadoop.hive.ql.exec.persistence.MapJoinObjectValue

      storage.get((byte) tag).add(value);

      for (Byte pos : order) {
        if (pos.intValue() != tag) {

          MapJoinObjectValue o = mapJoinTables.get(pos).get(key);
          MapJoinRowContainer<ArrayList<Object>> rowContainer = rowContainerMap.get(pos);

          // there is no join-value or join-key has all null elements
          if (o == null || key.hasAnyNulls()) {
            if (noOuterJoin) {
              storage.put(pos, emptyList);
            } else {
              storage.put(pos, dummyObjVectors[pos.intValue()]);
            }
          } else {
            rowContainer.reset(o.getObj());
            storage.put(pos, rowContainer);
          }
        }
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.exec.persistence.MapJoinObjectValue

          joinValuesObjectInspectors[alias], joinFilters[alias], joinFilterObjectInspectors[alias],
          filterMaps == null ? null : filterMaps[alias]);

      HashMapWrapper<AbstractMapJoinKey, MapJoinObjectValue> hashTable = mapJoinTables[alias];

      MapJoinObjectValue o = hashTable.get(keyMap);
      MapJoinRowContainer<Object[]> res = null;

      boolean needNewKey = true;
      if (o == null) {
        res = new MapJoinRowContainer<Object[]>();
        res.add(value);

        if (metadataValueTag[tag] == -1) {
          metadataValueTag[tag] = order[tag];
          setValueMetaData(tag);
        }

        // Construct externalizable objects for key and value
        if (needNewKey) {
          MapJoinObjectValue valueObj = new MapJoinObjectValue(
              metadataValueTag[tag], res);

          rowNumber++;
          if (rowNumber > hashTableScale && rowNumber % hashTableScale == 0) {
            isAbort = hashTable.isAbort(rowNumber, console);
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.