You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "László Bodor (Jira)" <ji...@apache.org> on 2021/08/17 12:31:00 UTC

[jira] [Updated] (HIVE-25459) Wrong VectorUDFMapIndexBaseScalar child class is used, leading to ClassCastException

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

László Bodor updated HIVE-25459:
--------------------------------
    Description: 
given this query:
{code}
CREATE TABLE map_of_doubles (
id int,
doubleMap map<double, double>
) stored as orc;
insert overwrite table map_of_doubles SELECT 1, MAP(CAST(1.0 as DOUBLE), null, CAST(2.0 as DOUBLE), CAST(3.0 as DOUBLE));

select id, doubleMap from map_of_doubles;
select id, doubleMap[1] from map_of_doubles group by id, doubleMap[1]; -- this fails
{code}

error is:
{code}
Caused by: java.lang.ClassCastException: org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector cannot be cast to org.apache.hadoop.hive.ql.exec.vector.LongColumnVector
	at org.apache.hadoop.hive.ql.exec.vector.expressions.VectorUDFMapIndexLongScalar.findScalarInMap(VectorUDFMapIndexLongScalar.java:67)
	at org.apache.hadoop.hive.ql.exec.vector.expressions.VectorUDFMapIndexBaseScalar.evaluate(VectorUDFMapIndexBaseScalar.java:132)
	at org.apache.hadoop.hive.ql.exec.vector.VectorSelectOperator.process(VectorSelectOperator.java:146)
	... 23 more
{code}

> Wrong VectorUDFMapIndexBaseScalar child class is used, leading to ClassCastException
> ------------------------------------------------------------------------------------
>
>                 Key: HIVE-25459
>                 URL: https://issues.apache.org/jira/browse/HIVE-25459
>             Project: Hive
>          Issue Type: Bug
>            Reporter: László Bodor
>            Assignee: László Bodor
>            Priority: Major
>
> given this query:
> {code}
> CREATE TABLE map_of_doubles (
> id int,
> doubleMap map<double, double>
> ) stored as orc;
> insert overwrite table map_of_doubles SELECT 1, MAP(CAST(1.0 as DOUBLE), null, CAST(2.0 as DOUBLE), CAST(3.0 as DOUBLE));
> select id, doubleMap from map_of_doubles;
> select id, doubleMap[1] from map_of_doubles group by id, doubleMap[1]; -- this fails
> {code}
> error is:
> {code}
> Caused by: java.lang.ClassCastException: org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector cannot be cast to org.apache.hadoop.hive.ql.exec.vector.LongColumnVector
> 	at org.apache.hadoop.hive.ql.exec.vector.expressions.VectorUDFMapIndexLongScalar.findScalarInMap(VectorUDFMapIndexLongScalar.java:67)
> 	at org.apache.hadoop.hive.ql.exec.vector.expressions.VectorUDFMapIndexBaseScalar.evaluate(VectorUDFMapIndexBaseScalar.java:132)
> 	at org.apache.hadoop.hive.ql.exec.vector.VectorSelectOperator.process(VectorSelectOperator.java:146)
> 	... 23 more
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)