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

Gzip text compressor doesn't always set output_length

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.0
    • Impala 2.1
    • None
    • None

    Description

      We hit a DCHECK failure in Compress() because output_length isn't always set. We need to set the output_length to the real output buffer size or zlib won't make any progress (or return with an error).

      create table temp like tpch_text_gzip.lineitem ;
      set compression_codec=GZIP;
      set ALLOW_UNSUPPORTED_FORMATS=1;
      insert into temp select * from tpch_text_gzip.lineitem;
      

      I think the fix is trivial (see below), but we should add a test case for this too.

      diff --git a/be/src/util/compress.cc b/be/src/util/compress.cc
      index 3713626..d0f57e4 100644
      --- a/be/src/util/compress.cc
      +++ b/be/src/util/compress.cc
      @@ -118,6 +118,7 @@ Status GzipCompressor::ProcessBlock(bool output_preallocated,
             *output_length = buffer_length_;
           }
           *output = out_buffer_;
      +    *output_length = buffer_length_;
         } else if (*output_length < max_compressed_len) {
           return Status("GzipCompressor::ProcessBlock: output length too small");
         }
      

      Attachments

        Activity

          People

            victor.bittorf_impala_fcb6 Victor Bittorf
            mjacobs Matthew Jacobs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: