rbalamohan commented on a change in pull request #1340:
URL: https://github.com/apache/hive/pull/1340#discussion_r464815905



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/mapjoin/fast/VectorMapJoinFastHashTableLoader.java
##########
@@ -125,13 +126,24 @@ public void load(MapJoinTableContainer[] mapJoinTables,
         KeyValueReader kvReader = (KeyValueReader) input.getReader();
 
         Long keyCountObj = parentKeyCounts.get(pos);
-        long keyCount = (keyCountObj == null) ? -1 : keyCountObj.longValue();
+        long estKeyCount = (keyCountObj == null) ? -1 : keyCountObj;
+
+        long inputRecords = -1;
+        try {
+          inputRecords = ((AbstractLogicalInput) 
input).getContext().getCounters().

Review comment:
       Can you add TODO or a followup ticket that would replace this string 
with actual TaskCounter enum from tez (in next subsequent tez release) ?

##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/mapjoin/fast/VectorMapJoinFastHashTableLoader.java
##########
@@ -125,13 +126,24 @@ public void load(MapJoinTableContainer[] mapJoinTables,
         KeyValueReader kvReader = (KeyValueReader) input.getReader();
 
         Long keyCountObj = parentKeyCounts.get(pos);
-        long keyCount = (keyCountObj == null) ? -1 : keyCountObj.longValue();
+        long estKeyCount = (keyCountObj == null) ? -1 : keyCountObj;
+
+        long inputRecords = -1;
+        try {
+          inputRecords = ((AbstractLogicalInput) 
input).getContext().getCounters().
+                  findCounter("org.apache.tez.common.counters.TaskCounter",
+                          "APPROXIMATE_INPUT_RECORDS").getValue();
+        } catch (Exception e) {
+          LOG.debug("Failed to get value for counter 
APPROXIMATE_INPUT_RECORDS", e);
+        }
+        long keyCount = Math.max(estKeyCount, inputRecords);
 
         VectorMapJoinFastTableContainer vectorMapJoinFastTableContainer =
                 new VectorMapJoinFastTableContainer(desc, hconf, keyCount);
 
-        LOG.info("Loading hash table for input: {} cacheKey: {} 
tableContainer: {} smallTablePos: {}", inputName,
-          cacheKey, 
vectorMapJoinFastTableContainer.getClass().getSimpleName(), pos);
+        LOG.info("Loading hash table for input: {} cacheKey: {} 
tableContainer: {} smallTablePos: {} " +

Review comment:
       Can you add "delta" (line 171) in the log as well, to have details on 
the hash table load time?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to