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/26 11:50:00 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17405174#comment-17405174 ] 

László Bodor commented on HIVE-25459:
-------------------------------------

same for decimals too:
{code}
Caused by: java.lang.ClassCastException: org.apache.hadoop.hive.ql.exec.vector.DecimalColumnVector 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:74)
	at org.apache.hadoop.hive.ql.exec.vector.VectorSelectOperator.process(VectorSelectOperator.java:146)
{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}
> I found this error while was trying to write q test cases for all data types in HIVE-23688, so this issue needs to be addressed first
> HIVE-23688 is Parquet-specific, this one is not, it can be reproduced for ORC and Parquet too



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