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

WriteSlot and CodegenWriteSlot handle escaped NULL slots differently

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 2.7.0
    • Fix Version/s: Impala 2.8.0
    • Component/s: Backend
    • Labels:

      Description

      We set the length of a slot as '-len' (i.e. the negative of the length) if the slot contains an escaped character.

      If the caller of WriteSlot() is about to pass a slot with an escaped character to WriteSlot(), it makes sure it sets the 'len' argument to positive and sets the 'need_escape' argument to true.

      A slot with '\N' (a default negative slot) will always have a negative length of -2, since it contains an escape character. WriteSlot() will receive the length for this slot as '2' (positive) and do a NULL check successfully.

      CodegenWriteSlot() uses the IRBuilder and the argument it receives for 'len' will be negative if the passed 'data' has an escape character. It then passes this negative length directly to the IrIsNullString() or IrGenericIsNullString() functions which do not expect a negative length.

      Therefore no slots will be marked as NULL slots by this check when codegen is enabled.

      We've been getting by so far because there was some buggy code after the NULL check which marked invalid blocks and NULL blocks as NULL instead of giving an error back to the user for the invalid blocks case, leading to IMPALA-1862.

        Issue Links

          Activity

          Show
          sailesh Sailesh Mukil added a comment - Commit in: https://github.com/apache/incubator-impala/commit/b00310ca897de325c8c6bd67f430885cddd322da

            People

            • Assignee:
              sailesh Sailesh Mukil
              Reporter:
              sailesh Sailesh Mukil
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development