[
https://issues.apache.org/jira/browse/CALCITE-1386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15525412#comment-15525412
]
Jungtaek Lim commented on CALCITE-1386:
---------------------------------------
I submitted pull request for this issue:
https://github.com/apache/calcite/pull/283
Please grant me to the contributor list for Calcite project. Thanks!
> ITEM operator seems to ignore the value type of collection and assign the
> value to Object
> -----------------------------------------------------------------------------------------
>
> Key: CALCITE-1386
> URL: https://issues.apache.org/jira/browse/CALCITE-1386
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.9.0
> Reporter: Jungtaek Lim
> Assignee: Julian Hyde
>
> Suppose we're defining the following table:
> {code}
> .field("ID", SqlTypeName.INTEGER)
> .field("MAPFIELD",
> typeFactory.createMapType(
> typeFactory.createSqlType(SqlTypeName.VARCHAR),
> typeFactory.createTypeWithNullability(
> typeFactory.createSqlType(SqlTypeName.INTEGER),
> true)))
> .field("NESTEDMAPFIELD",
> typeFactory.createMapType(
> typeFactory.createSqlType(SqlTypeName.VARCHAR),
> typeFactory.createTypeWithNullability(
> typeFactory.createMapType(
>
> typeFactory.createSqlType(SqlTypeName.VARCHAR),
> typeFactory.createTypeWithNullability(
>
> typeFactory.createSqlType(SqlTypeName.INTEGER), true))
> , true)))
> .field("ARRAYFIELD", typeFactory.createArrayType(
> typeFactory.createTypeWithNullability(
> typeFactory.createSqlType(SqlTypeName.INTEGER), true), -1L))
> {code}
> and query like this:
> {code}
> SELECT * FROM <TBL> WHERE MAPFIELD['a'] = 1
> {code}
> When we evaluate that query, JaninoRexCompiler throws an Exception saying
> there's no SqlFunctions.eq(Object, int).
> I took a breakpoint on BinaryImplementor.implement() to see variables just
> before compiler finds SqlFunctions.eq().
> The type of expression is Object which is not generic, but seems like
> matching RexCall operand have value type information.
> (I mean type mismatch occurs.)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)