Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1976

makeLiteral(Arrays.asList(...), structType, allowCast=any) does not work for Enumerable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.13.0
    • Fix Version/s: 1.15.0
    • Component/s: core
    • Labels:
      None

      Description

      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:

                  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")),
      ...
      

        Activity

        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.15.0 (2017-12-11).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.15.0 (2017-12-11).
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/41687f3b .
        Hide
        vladimirsitnikov Vladimir Sitnikov added a comment -

        Thanks for the review.

        Show
        vladimirsitnikov Vladimir Sitnikov added a comment - Thanks for the review.
        Hide
        julianhyde Julian Hyde added a comment -

        Looks good. I'll commit right after 1.14.

        Show
        julianhyde Julian Hyde added a comment - Looks good. I'll commit right after 1.14.
        Hide
        vladimirsitnikov Vladimir Sitnikov added a comment -
        Show
        vladimirsitnikov Vladimir Sitnikov added a comment - See PR here: https://github.com/apache/calcite/pull/534

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            vladimirsitnikov Vladimir Sitnikov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development