hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <>
Subject [jira] [Work logged] (HIVE-23365) Put RS deduplication optimization under cost based decision
Date Mon, 01 Jun 2020 21:49:00 GMT


ASF GitHub Bot logged work on HIVE-23365:

                Author: ASF GitHub Bot
            Created on: 01/Jun/20 21:48
            Start Date: 01/Jun/20 21:48
    Worklog Time Spent: 10m 
      Work Description: zabetak commented on a change in pull request #1035:

File path: ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/
@@ -197,6 +186,27 @@ public static boolean merge(ReduceSinkOperator cRS, ReduceSinkOperator
pRS, int
     return true;
+  private static long estimateReducers(HiveConf conf, ReduceSinkOperator rs) {
+    // TODO: Check if we can somehow exploit the logic in SetReducerParallelism
+    if (rs.getConf().getNumReducers() > 0) {
+      return rs.getConf().getNumReducers();
+    }
+    int constantReducers = conf.getIntVar(HiveConf.ConfVars.HADOOPNUMREDUCERS);
+    if (constantReducers > 0) {
+      return constantReducers;
+    }
+    long inputTotalBytes = 0;
+    List<Operator<?>> rsSiblings = rs.getChildOperators().get(0).getParentOperators();
+    for (Operator<?> sibling : rsSiblings) {
+      if (sibling.getStatistics() != null) {

Review comment:
       In the caller of this method, before checking if the new parallelism is very low, we
are checking if the parallelism changes (`newParallelism < oldParallelism`). If the parallelism
does not change then we proceed in the deduplication as usual. If we don't have stats then
the snippet below will return 1. The same will happen for both parent RS and child RS so the
parallelism does not change since `1 < 1` returns false. 
   If you prefer to have an explicit check for the presence/absence of stats I can try to
add it. Let me know.  

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:

Issue Time Tracking

    Worklog Id:     (was: 439759)
    Time Spent: 50m  (was: 40m)

> Put RS deduplication optimization under cost based decision
> -----------------------------------------------------------
>                 Key: HIVE-23365
>                 URL:
>             Project: Hive
>          Issue Type: Improvement
>          Components: Physical Optimizer
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Stamatis Zampetakis
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-23365.01.patch, HIVE-23365.02.patch, HIVE-23365.03.patch, HIVE-23365.04.patch,
>          Time Spent: 50m
>  Remaining Estimate: 0h
> Currently, RS deduplication is always executed whenever it is semantically correct. However,
it could be beneficial to leave both RS operators in the plan, e.g., if the NDV of the second
RS is very low. Thus, we would like this decision to be cost-based. We could use a simple
heuristic that would work fine for most of the cases without introducing regressions for existing
cases, e.g., if NDV for partition column is less than estimated parallelism in the second
RS, do not execute deduplication.

This message was sent by Atlassian Jira

View raw message