hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prasanth J (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-5272) Column statistics on a invalid column name results in IndexOutOfBoundsException
Date Thu, 26 Sep 2013 18:59:04 GMT

    [ https://issues.apache.org/jira/browse/HIVE-5272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13779096#comment-13779096
] 

Prasanth J commented on HIVE-5272:
----------------------------------

The reason for these failure are not related to this patch. Its related to HIVE-5318. The
import_exported_table.q test case checked in as a part of HIVE-5318 creates a dfs folder but
failed to delete the folder completely (it deleted only the subdirectory but not the main
directory it created). The subsequent tests uses the same dfs folder and since it is not deleted
it threw exception and caused the tests to fail. 

Added a fix for it in the .3 version patch. Also attaching the test report for these failing
test cases. The tests are successful now. 
                
> 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.txt, HIVE-5272.2.patch.txt, HIVE-5272.3.patch.txt,
junit-noframes.html
>
>
> 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 <numCols; 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

Mime
View raw message