hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aihua Xu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-11451) SemanticAnalyzer throws IndexOutOfBounds Exception
Date Tue, 04 Aug 2015 15:53:04 GMT

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

Aihua Xu commented on HIVE-11451:
---------------------------------

We should check if the number of target table columns match the selected #columns before going
through the column to type conversion. 

At the mean time, you should provide matched number of columns in the select subquery.


> SemanticAnalyzer throws IndexOutOfBounds Exception
> --------------------------------------------------
>
>                 Key: HIVE-11451
>                 URL: https://issues.apache.org/jira/browse/HIVE-11451
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Prasanth Jayachandran
>            Assignee: Aihua Xu
>            Priority: Critical
>
> Following queries throw IndexOutOfBoundsException in SemanticAnalyzer
> {code:title=Queries|borderStyle=solid}
> CREATE TABLE staging(t tinyint,
>            si smallint,
>            i int,
>            b bigint,
>            f float,
>            d double,
>            bo boolean,
>            s string,
>            ts timestamp,
>            dec decimal(4,2),
>            bin binary)
> ROW FORMAT DELIMITED FIELDS TERMINATED BY '|'
> STORED AS TEXTFILE;
> LOAD DATA LOCAL INPATH '../../data/files/over1k' OVERWRITE INTO TABLE staging;
> CREATE TABLE orc_ppd(t tinyint,
>            si smallint,
>            i int,
>            b bigint,
>            f float,
>            d double,
>            bo boolean,
>            s string,
>            c char(50),
>            v varchar(50),
>            da date,
>            ts timestamp,
>            dec decimal(4,2),
>            bin binary)
> STORED AS ORC tblproperties("orc.row.index.stride" = "1000");
> insert overwrite table orc_ppd select si, i, b, f, d, bo, s, cast(s as char(50)), cast(s
as varchar(50)), cast(ts as date), ts, dec, bin from staging;
> {code}
> {code:title=StackTrace|borderStyle=solid}
> java.lang.IndexOutOfBoundsException: Index: 13, Size: 13
>         at java.util.ArrayList.rangeCheck(ArrayList.java:635)
>         at java.util.ArrayList.get(ArrayList.java:411)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genConversionSelectOperator(SemanticAnalyzer.java:6754)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genFileSinkPlan(SemanticAnalyzer.java:6543)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPostGroupByBodyPlan(SemanticAnalyzer.java:8989)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:8880)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:9730)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:9623)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genOPTree(SemanticAnalyzer.java:10115)
>         at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:330)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10126)
>         at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:209)
>         at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:240)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:422)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:310)
>         at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1139)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1192)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1068)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1058)
>         at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:213)
>         at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:165)
>         at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:376)
>         at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:736)
>         at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)
>         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message