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-22238) PK/FK selectivity estimation underscales estimations
Date Fri, 01 Nov 2019 05:34:00 GMT


ASF GitHub Bot logged work on HIVE-22238:

                Author: ASF GitHub Bot
            Created on: 01/Nov/19 05:33
            Start Date: 01/Nov/19 05:33
    Worklog Time Spent: 10m 
      Work Description: jcamachor commented on pull request #831: HIVE-22238 pkfk

 File path: ql/src/java/org/apache/hadoop/hive/ql/hooks/
 @@ -0,0 +1,146 @@
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.ql.hooks;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.ql.exec.ExplainTask;
+import org.apache.hadoop.hive.ql.exec.Operator;
+import org.apache.hadoop.hive.ql.exec.Task;
+import org.apache.hadoop.hive.ql.lib.DefaultGraphWalker;
+import org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher;
+import org.apache.hadoop.hive.ql.lib.Dispatcher;
+import org.apache.hadoop.hive.ql.lib.GraphWalker;
+import org.apache.hadoop.hive.ql.lib.Node;
+import org.apache.hadoop.hive.ql.lib.NodeProcessor;
+import org.apache.hadoop.hive.ql.lib.NodeProcessorCtx;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.parse.AbstractSemanticAnalyzerHook;
+import org.apache.hadoop.hive.ql.parse.HiveSemanticAnalyzerHookContext;
+import org.apache.hadoop.hive.ql.parse.SemanticException;
+import org.apache.hadoop.hive.ql.plan.BaseWork;
+import org.apache.hadoop.hive.ql.plan.ExplainWork;
+import org.apache.hadoop.hive.ql.plan.MapWork;
+import org.apache.hadoop.hive.ql.plan.MapredWork;
+import org.apache.hadoop.hive.ql.plan.ReduceWork;
+import org.apache.hadoop.hive.ql.plan.Statistics;
+import org.apache.hadoop.hive.ql.plan.TezWork;
+ * Adds an extra check for Explain Analyze queries.
+ */
+public class AccurateEstimatesCheckerHook extends AbstractSemanticAnalyzerHook {
 Review comment:
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: 337193)

> PK/FK selectivity estimation underscales estimations
> ----------------------------------------------------
>                 Key: HIVE-22238
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: Statistics
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-22238.01.patch, HIVE-22238.02.patch, HIVE-22238.03.patch, HIVE-22238.04.patch,
HIVE-22238.05.patch, HIVE-22238.05.patch, HIVE-22238.05.patch, HIVE-22238.05.patch, HIVE-22238.05.patch
>          Time Spent: 20m
>  Remaining Estimate: 0h
> at [this point|]
the parent operators rownum is scaled according to pkfkselectivity
> however [pkfkselectivity is computed|]
on a whole subtree.
> Scaling it by that amount will count in estimation already used when parentstats was depending on the number of upstream joins - this may lead to severe underestimations
> what happened was:
> * optimization was able to push the filter to the other side of the join
> * as a result the incoming data was already filtered
> * scaling down by the PK selectiviy - was actually already there...but a new "scaling"

This message was sent by Atlassian Jira

View raw message