[
https://issues.apache.org/jira/browse/CALCITE-1386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Hyde resolved CALCITE-1386.
----------------------------------
Resolution: Fixed
Fix Version/s: 1.10.0
Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/963876bb. Thanks
for the PR, [~kabhwan]!
> 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
> Fix For: 1.10.0
>
>
> 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)