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

RowBatch::AcquireState() cannot be used if the initial capacity of a RowBatch is not known

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.7.0
    • Impala 2.8.0
    • Backend
    • None

    Description

      If you want to acquire the state of a row batch, the usual pattern is something like:

      RowBatch dest(src->row_desc(), batch->capacity(), mem_tracker);
      dest.AcquireState(src);
      

      AcquireState() checks to see if the allocated space for tuple ptrs is the same in both batches - this is calculated by capacity * num_tuples_per_row * sizeof(Tuple*), and is fixed in the constructor.

      But capacity can change after construction, by calling MarkCapacity(). If this happens, dest will allocate too little memory for the tuple ptrs, and AcquireState() will hit a DCHECK.

      The solution seems to be recording the maximum capacity in the c'tor, and using that when constructing dest.

      Attachments

        Activity

          People

            henryr Henry Robinson
            henryr Henry Robinson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: