Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 309E47FA7 for ; Fri, 5 Aug 2011 21:20:59 +0000 (UTC) Received: (qmail 45182 invoked by uid 500); 5 Aug 2011 21:20:58 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 45125 invoked by uid 500); 5 Aug 2011 21:20:58 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 45100 invoked by uid 500); 5 Aug 2011 21:20:58 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 45092 invoked by uid 99); 5 Aug 2011 21:20:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Aug 2011 21:20:58 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Aug 2011 21:20:54 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 900DAACAFA for ; Fri, 5 Aug 2011 21:20:32 +0000 (UTC) Date: Fri, 5 Aug 2011 21:20:32 +0000 (UTC) From: "jiraposter@reviews.apache.org (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: <1333268538.12952.1312579232586.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HIVE-1694) Accelerate GROUP BY execution using indexes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HIVE-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080235#comment-13080235 ] jiraposter@reviews.apache.org commented on HIVE-1694: ----------------------------------------------------- ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1194/#review1303 ----------------------------------------------------------- ql/src/java/org/apache/hadoop/hive/ql/index/AggregateIndexHandler.java Can't you just look up "AGGREGATES" in the map? ql/src/java/org/apache/hadoop/hive/ql/index/AggregateIndexHandler.java Add a helper method to avoid duplicating the code in the else block below. ql/src/java/org/apache/hadoop/hive/ql/index/AggregateIndexHandler.java Can't you just look up "AGGREGATES" in the map? ql/src/java/org/apache/hadoop/hive/ql/index/AggregateIndexHandler.java See recent changes in corresponding CompactIndexHandler code for HIVEOPTINDEXFILTER; need the same here (or better, factor out common code here and elsewhere). On a related note, you may be able to use the same technique instead of isQueryInsertToTable; this would be preferable since it's nice to be able to use the index rewrite in cases where it's a normal INSERT table with index being used for GROUP BY on SELECT from some other table. ql/src/java/org/apache/hadoop/hive/ql/optimizer/IndexUtils.java @params here don't match actual params ql/src/java/org/apache/hadoop/hive/ql/optimizer/index/RewriteCanApplyProcFactory.java Shouldn't this be the same as COUNT(*)? ql/src/test/queries/clientpositive/ql_rewrite_gbtoidx.q Besides EXPLAIN, you should include a few queries against a non-empty table verifying that you get the correct results both with and without the optimization applied. Remember to include an ORDER BY for test determinism. ql/src/test/queries/clientpositive/ql_rewrite_gbtoidx.q Isn't this set redundant? - John On 2011-08-03 10:31:42, Prajakta Kalmegh wrote: bq. bq. ----------------------------------------------------------- bq. This is an automatically generated e-mail. To reply, visit: bq. https://reviews.apache.org/r/1194/ bq. ----------------------------------------------------------- bq. bq. (Updated 2011-08-03 10:31:42) bq. bq. bq. Review request for hive and John Sichi. bq. bq. bq. Summary bq. ------- bq. bq. This patch has defined a new AggregateIndexHandler which is used to optimize the query plan for groupby queries. bq. bq. bq. This addresses bug HIVE-1694. bq. https://issues.apache.org/jira/browse/HIVE-1694 bq. bq. bq. Diffs bq. ----- bq. bq. common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b46976f bq. ql/src/java/org/apache/hadoop/hive/ql/index/AggregateIndexHandler.java PRE-CREATION bq. ql/src/java/org/apache/hadoop/hive/ql/index/HiveIndex.java 591c9ff bq. ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java a57f9cf bq. ql/src/java/org/apache/hadoop/hive/ql/optimizer/IndexUtils.java PRE-CREATION bq. ql/src/java/org/apache/hadoop/hive/ql/optimizer/Optimizer.java 590d69a bq. ql/src/java/org/apache/hadoop/hive/ql/optimizer/index/RewriteCanApplyCtx.java PRE-CREATION bq. ql/src/java/org/apache/hadoop/hive/ql/optimizer/index/RewriteCanApplyProcFactory.java PRE-CREATION bq. ql/src/java/org/apache/hadoop/hive/ql/optimizer/index/RewriteGBUsingIndex.java PRE-CREATION bq. ql/src/java/org/apache/hadoop/hive/ql/optimizer/index/RewriteParseContextGenerator.java PRE-CREATION bq. ql/src/java/org/apache/hadoop/hive/ql/optimizer/index/RewriteQueryUsingAggregateIndex.java PRE-CREATION bq. ql/src/java/org/apache/hadoop/hive/ql/optimizer/index/RewriteQueryUsingAggregateIndexCtx.java PRE-CREATION bq. ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/index/IndexWhereProcessor.java 8295687 bq. ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/index/IndexWhereTaskDispatcher.java 699519b bq. ql/src/test/queries/clientpositive/ql_rewrite_gbtoidx.q PRE-CREATION bq. ql/src/test/results/clientpositive/ql_rewrite_gbtoidx.q.out PRE-CREATION bq. bq. Diff: https://reviews.apache.org/r/1194/diff bq. bq. bq. Testing bq. ------- bq. bq. bq. Thanks, bq. bq. Prajakta bq. bq. > Accelerate GROUP BY execution using indexes > ------------------------------------------- > > Key: HIVE-1694 > URL: https://issues.apache.org/jira/browse/HIVE-1694 > Project: Hive > Issue Type: New Feature > Components: Indexing, Query Processor > Affects Versions: 0.7.0 > Reporter: Nikhil Deshpande > Assignee: Prajakta Kalmegh > Attachments: HIVE-1694.1.patch.txt, HIVE-1694.2.patch.txt, HIVE-1694.3.patch.txt, HIVE-1694.4.patch, HIVE-1694.5.patch, HIVE-1694_2010-10-28.diff, demo_q1.hql, demo_q2.hql > > > The index building patch (Hive-417) is checked into trunk, this JIRA issue tracks supporting indexes in Hive compiler & execution engine for SELECT queries. > This is in ref. to John's comment at > https://issues.apache.org/jira/browse/HIVE-417?focusedCommentId=12884869&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12884869 > on creating separate JIRA issue for tracking index usage in optimizer & query execution. > The aim of this effort is to use indexes to accelerate query execution (for certain class of queries). E.g. > - Filters and range scans (already being worked on by He Yongqiang as part of HIVE-417?) > - Joins (index based joins) > - Group By, Order By and other misc cases > The proposal is multi-step: > 1. Building index based operators, compiler and execution engine changes > 2. Optimizer enhancements (e.g. cost-based optimizer to compare and choose between index scans, full table scans etc.) > This JIRA initially focuses on the first step. This JIRA is expected to hold the information about index based plans & operator implementations for above mentioned cases. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira