You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2017/09/08 17:33:01 UTC

[jira] [Updated] (CALCITE-1976) makeLiteral(Arrays.asList(...), structType, allowCast=any) does not work for Enumerable

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

Julian Hyde updated CALCITE-1976:
---------------------------------
    Fix Version/s: 1.15.0

> makeLiteral(Arrays.asList(...), structType, allowCast=any) does not work for Enumerable
> ---------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1976
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1976
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.13.0
>            Reporter: Vladimir Sitnikov
>            Assignee: Julian Hyde
>             Fix For: 1.15.0
>
>
> org.apache.calcite.adapter.enumerable.RexToLixTranslator#translateLiteral creates ConstantExpression with {{List}} contents, and  org.apache.calcite.linq4j.tree.ConstantExpression#write just misses a case for List/Map, thus it resorts to plain {{toString}} and produces the following code:
> {code:java}
>             public Object current() {
>               final org.eclipse.mat.snapshot.model.IObject v0 = com.github.vlsi.mat.calcite.functions.ISnapshotMethods.getIObject(com.github.vlsi.mat.calcite.SnapshotHo
>               return new Object[] {
>                   com.github.vlsi.mat.calcite.functions.ISnapshotMethods.toReference(v0),
>                   [0, 1], <-- does not compile
>                   org.apache.calcite.runtime.SqlFunctions.toFloat(com.github.vlsi.mat.calcite.functions.IObjectMethods.resolveSimpleValue(v0, "loadFactor")),
> ...
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)