You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Dmitry Lychagin (JIRA)" <ji...@apache.org> on 2019/04/17 22:21:00 UTC

[jira] [Commented] (ASTERIXDB-2550) ClassCastException at compile time

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

Dmitry Lychagin commented on ASTERIXDB-2550:
--------------------------------------------

Expected error:
{noformat}
ASX0037: Type mismatch: expected value of type array or multiset, but got the value of type object{noformat}

> ClassCastException at compile time
> ----------------------------------
>
>                 Key: ASTERIXDB-2550
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2550
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: COMP - Compiler
>    Affects Versions: 0.9.4
>            Reporter: Dmitry Lychagin
>            Assignee: Dmitry Lychagin
>            Priority: Minor
>             Fix For: 0.9.4.2
>
>
> DDL: 
> {noformat}
> create type test.TestType as { id : integer };
> create dataset t1(TestType) primary key id;
> {noformat}
> Query:
> {noformat}
> SELECT * FROM (
>   SELECT a FROM t1
> )[0] i
> {noformat}
> Exception:
> {noformat}
> java.lang.ClassCastException: org.apache.asterix.om.types.ARecordType cannot be cast to org.apache.asterix.om.types.AbstractCollectionType
>         at org.apache.asterix.om.typecomputer.impl.CollectionMemberResultType.getResultType(CollectionMemberResultType.java:69) ~[classes/:?]
>         at org.apache.asterix.om.typecomputer.impl.TypeComputeUtils.resolveResultType(TypeComputeUtils.java:124) ~[classes/:?]
>         at org.apache.asterix.om.typecomputer.base.AbstractResultTypeComputer.computeType(AbstractResultTypeComputer.java:44) ~[classes/:?]
>         at org.apache.asterix.dataflow.data.common.ExpressionTypeComputer.getTypeForFunction(ExpressionTypeComputer.java:84) ~[classes/:?]
>         at org.apache.asterix.dataflow.data.common.ExpressionTypeComputer.getType(ExpressionTypeComputer.java:55) ~[classes/:?]
>         at org.apache.hyracks.algebricks.core.algebra.typing.AbstractTypeEnvironment.getType(AbstractTypeEnvironment.java:45) ~[classes/:?]
>         at org.apache.hyracks.algebricks.core.algebra.operators.logical.UnnestOperator.computeOutputTypeEnvironment(UnnestOperator.java:51) ~[classes/:?]
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)