Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-11685

Slot memory sharing between struct and field not working if the field is also a struct

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • Frontend
    • None
    • ghx-label-3

    Description

      IMPALA-10838 introduced that if a struct and one of its fields are both present in the select list, no extra slot is generated in the row for the struct field but the memory of the struct is reused, i.e. the row size is the same as when only the struct is queried. It works when the struct field is a primitive type:

      explain select id, outer_struct from functional_orc_def.complextypes_nested_structs;
      row-size=64B
      explain select id, outer_struct, outer_struct.str from functional_orc_def.complextypes_nested_structs;
      row-size=64B

      However, it does not if the child is itself a struct:

      explain select id, outer_struct, outer_struct.inner_struct3 from functional_orc_def.complextypes_nested_structs;
      row-size=80B

      This is because struct slot descriptors are registered before others so that it is easier to reuse the slot memory of the struct fields, but struct slot descriptors among themselves are sorted in the wrong order (see https://github.com/apache/impala/blob/c12ac6c27b2df1eae693b44c157d65499f491d21/fe/src/main/java/org/apache/impala/analysis/SelectStmt.java#L340).

      Attachments

        Issue Links

          Activity

            People

              daniel.becker Daniel Becker
              daniel.becker Daniel Becker
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: