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

Enumerable<Holder> where Holder is custom class with a single field does not work

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-incubating
    • Fix Version/s: 1.0.0-incubating
    • Component/s: None
    • Labels:
      None

      Description

      Calcite treats it as SCALAR (due to JavaRowFormat.optimize), thus field access does not work.

      public final IntHolder[] primesCustomBoxed =
              new IntHolder[]{new IntHolder(1), new IntHolder(3), new IntHolder(5)};
      
        @Test public void testCustomBoxedScalar() {
          CalciteAssert.that()
              .with("s", new ReflectiveSchemaTest.CatchallSchema())
              .query("select \"value\" from \"s\".\"primesCustomBoxed\"")
              .returnsUnordered("1", "3", "5");
        }
      Caused by: arrays first differed at element [0]; expected:<[1]> but was:<[value=org.apache.calcite.test.ReflectiveSchemaTest$IntHolder@2aa3cd93]>

        Activity

        Show
        vladimirsitnikov Vladimir Sitnikov added a comment - Fixed in https://git-wip-us.apache.org/repos/asf?p=incubator-calcite.git;a=commitdiff;h=28fd9c8b991ff30d3657bc56a0f2c1b84261aac4
        Hide
        julianhyde Julian Hyde added a comment -

        Closing now that 1.0.0-incubating has been released.

        Show
        julianhyde Julian Hyde added a comment - Closing now that 1.0.0-incubating has been released.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development