[ 
https://issues.apache.org/jira/browse/HIVE-11880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

WangMeng updated HIVE-11880:
----------------------------
    Description: 
   For Hive UNION ALL , when a union column is constant(column a such as '0L')  
and it has incompatible type with the corresponding column A. The query with 
filter condition on type incompatible column a on this UNION-ALL results  will 
cause IndexOutOfBoundsException

  Such as TPC-H table "orders", we  CREATE VIEW `view_orders` AS select 
`oo`.`o_orderkey` , `oo`.`o_custkey`  from (  select  `orders`.`o_orderkey` , 
`rcfileorders`.`o_custkey` from `tpch270g`.`rcfileorders`   union all  select 
`orcfileorders`.`o_orderkey` , 0L as `o_custkey`   from  
`tpch270g`.`textfileorders`) `oo`.

   Type of 'o_custkey' is INT normally, while  the type of corresponding column 
constant "0" is BIGINT.

   Then the fllowing query(with filter incompatible column 0_custkey)  will 
fail  with  java.lang.IndexOutOfBoundsException:
    'select count(1) from view_orders  where o_custkey<100000 '.

  was:
   For Hive UNION ALL , when a union column is constant(column a such as '0L')  
and it has incompatible type with the corresponding column A. The query with 
filter condition on type incompatible column a on this UNION-ALL results  will 
cause IndexOutOfBoundsException

  Such as TPC-H table "orders", we  CREATE VIEW `view_orders` AS select 
`oo`.`o_orderkey` , `oo`.`o_custkey`  from (  select  `orders`.`o_orderkey` , 
`rcfileorders`.`o_custkey` from `tpch270g`.`rcfileorders`   union all  select 
`orcfileorders`.`o_orderkey` , 0L as `o_custkey`   from  
`tpch270g`.`textfileorders`) `oo`.

   Type of 'o_custkey' is INT,  the type of corresponding constant "0" is 
BIGINT.

   Then the fllowing query(with filter incompatible column 0_custkey)  will 
fail  with  java.lang.IndexOutOfBoundsException:
    'select count(1) from view_orders  where o_custkey<100000 '.


>    IndexOutOfBoundsException when execute query with filter condition on type 
> incompatible column on data(generated by UNION ALL with an union column is 
> constant and it has incompatible type with corresponding column) 
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-11880
>                 URL: https://issues.apache.org/jira/browse/HIVE-11880
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 1.2.1
>            Reporter: WangMeng
>            Assignee: WangMeng
>
>    For Hive UNION ALL , when a union column is constant(column a such as 
> '0L')  and it has incompatible type with the corresponding column A. The 
> query with filter condition on type incompatible column a on this UNION-ALL 
> results  will cause IndexOutOfBoundsException
>   Such as TPC-H table "orders", we  CREATE VIEW `view_orders` AS select 
> `oo`.`o_orderkey` , `oo`.`o_custkey`  from (  select  `orders`.`o_orderkey` , 
> `rcfileorders`.`o_custkey` from `tpch270g`.`rcfileorders`   union all  select 
> `orcfileorders`.`o_orderkey` , 0L as `o_custkey`   from  
> `tpch270g`.`textfileorders`) `oo`.
>    Type of 'o_custkey' is INT normally, while  the type of corresponding 
> column constant "0" is BIGINT.
>    Then the fllowing query(with filter incompatible column 0_custkey)  will 
> fail  with  java.lang.IndexOutOfBoundsException:
>     'select count(1) from view_orders  where o_custkey<100000 '.



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

Reply via email to