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

Support Char type in codegen

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Impala 2.6.0
    • Fix Version/s: None
    • Component/s: Backend
    • Labels:

      Description

      There are multiple places in the backend which explicitly punt on codegen if there is CHAR type involved. Examples include:

      ScalarFnCall::GetCodegendComputeFn(...) {
      ....
        for (int i = 0; i < GetNumChildren(); ++i) {
          if (children_[i]->type().type == TYPE_CHAR) {
            *fn = NULL;
            return Status("ScalarFnCall Codegen not supported for CHAR");
          }
        }
      ....
      }
      
      StructType* TupleDescriptor::GetLlvmStruct(LlvmCodeGen* codegen) const {
      ...
      
        // Add the slot types to the struct description.
        for (int i = 0; i < slots().size(); ++i) {
          SlotDescriptor* slot_desc = slots()[i];
          if (slot_desc->type().type == TYPE_CHAR) return NULL; <<---
          slot_desc->field_idx_ = slot_desc->slot_idx_ + num_null_bytes_;
          DCHECK_LT(slot_desc->field_idx(), struct_fields.size());
          struct_fields[slot_desc->field_idx()] = codegen->GetType(slot_desc->type());
        }
      ....
      }
      

      The support for CHAR was disabled in f1c4e49905c57d91a8af455fe2537ae9cfb8110c because of various bugs.

      IMPALA-5560 simplified the CHAR data type implementation and IMPALA-3931 added some support for codegen of a FIXED_UDA_INTERMEDIATE type with the same memory layout as CHAR. We've also fixed the other cases where codegen was disabled for specific data types, so enabling char codegen may actually be less error-prone than keeping it disabled and requiring all the requisite error-handling.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kwho Michael Ho
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: