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

IndexOutOfBoundsException in RelStructuredTypeFlattener when accessing nested fields

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.19.0
    • Fix Version/s: 1.21.0
    • Component/s: core
    • Labels:
      None

      Description

      When accessing nested field in a STRUCTURED SqlType, sometimes RelStructuredTypeFlattener will crash with java.lang.IndexOutOfBoundsException

      The test case is in SqlToRelConverterTest.java

      @Test
      public void testNestedColumnCrash()

      { final String sql = "select mailing_address.zip from sales.emp_address where home_address.city = 'abc'"; sql(sql).ok(); }

       

      The root cause is that when generate new RelNode for old RelNode, we did not consider whether the flattened field list needs null indicator. 

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ihuzenko Igor Guzenko
                Reporter:
                my7ym Will Yu
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: