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

min(), max(), and first_value() will DCHECK on empty strings

    XMLWordPrintableJSON

Details

    Description

      This is a very easy bug to fix, we need to remove/change the following DCHECK:

      static void CopyStringVal(FunctionContext* ctx, const StringVal& src, StringVal* dst) {
        DCHECK_GT(src.len, 0); // <---- this DCHECK is wrong, should be GE
        uint8_t* copy = ctx->Allocate(src.len);
        if (UNLIKELY(copy == NULL)) {
          DCHECK(!ctx->impl()->state()->GetQueryStatus().ok());
          *dst = StringVal::null();
        } else {
          *dst = StringVal(copy, src.len);
          memcpy(dst->ptr, src.ptr, src.len);
        }
      

      However, it appears we have very little to no test coverage on empty strings. This should also be added.

      Attachments

        Activity

          People

            kwho Michael Ho
            skye Skye Wanderman-Milne
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: