Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-2680

TOBAG output schema reporting

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.10.0
    • 0.11, 0.10.1
    • internal-udfs
    • None
    • Patch Available

    Description

      TOBAG only reports an output schema beyond {{

      {(NULL)}

      }} when all input field schemas match deeply, including field schema aliases. This seems wrong to me. Shouldn't it just require recursive type equality?

      For relevant code, see:

      http://svn.apache.org/viewvc/pig/tags/release-0.9.2/src/org/apache/pig/builtin/TOBAG.java?view=markup#l142

          private boolean nullEquals(Schema currentSchema, Schema newSchema) {
              if(currentSchema == null){
                  if(newSchema != null){
                      return false;
                  }
                  return true;
              }
              return currentSchema.equals(newSchema);
          }
      

      The included patch modifies the return line to use Schema.equals(currentSchema, newSchema, false, true) to avoid alias matching requirement.

      Attachments

        1. fixes_tobag_input_schema_validation.patch
          0.5 kB
          Andy Schlaikjer
        2. fixes_tobag_input_schema_validation-r2.patch
          2 kB
          Andy Schlaikjer

        Activity

          People

            Unassigned Unassigned
            hazen Andy Schlaikjer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: