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 9FA34CF72 for ; Mon, 23 Sep 2013 08:08:10 +0000 (UTC) Received: (qmail 13860 invoked by uid 500); 23 Sep 2013 08:08:06 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 13779 invoked by uid 500); 23 Sep 2013 08:08:05 -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 13680 invoked by uid 500); 23 Sep 2013 08:08:03 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 13670 invoked by uid 99); 23 Sep 2013 08:08:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Sep 2013 08:08:02 +0000 Date: Mon, 23 Sep 2013 08:08:02 +0000 (UTC) From: "Ashutosh Chauhan (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-5272) Column statistics on a invalid column name results in IndexOutOfBoundsException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-5272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13774367#comment-13774367 ] Ashutosh Chauhan commented on HIVE-5272: ---------------------------------------- [~prasanth_j] If you have already run tests, can you post the results here? > Column statistics on a invalid column name results in IndexOutOfBoundsException > ------------------------------------------------------------------------------- > > Key: HIVE-5272 > URL: https://issues.apache.org/jira/browse/HIVE-5272 > Project: Hive > Issue Type: Bug > Components: Statistics > Affects Versions: 0.13.0 > Reporter: Prasanth J > Assignee: Prasanth J > Labels: statistics > Fix For: 0.13.0 > > Attachments: HIVE-5272.1.patch > > > When invalid column name is specified for column statistics IndexOutOfBoundsException is thrown. > {code}hive> analyze table customer_staging compute statistics for columns c_first_name, invalid_name, c_customer_sk; > FAILED: IndexOutOfBoundsException Index: 2, Size: 1{code} > If the invalid column name appears at first or last then INVALID_COLUMN_REFERENCE is thrown at query planning stage. But if the invalid column name appears somewhere in the middle of column lists then IndexOutOfBoundsException is thrown at semantic analysis step. The problem is with getTableColumnType() and getPartitionColumnType() methods. The following segment > {code} for (int i=0; i colName = colNames.get(i); > for (FieldSchema col: cols) { > if (colName.equalsIgnoreCase(col.getName())) { > colTypes.add(i, new String(col.getType())); > } > } > }{code} > is the reason for it. If the invalid column names appears in the middle of column list then the equalsIgnoreCase() skips the invalid name and increments the i. Since the list is not initialized it results in exception. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira