Uploaded image for project: 'Parquet'
  1. Parquet
  2. PARQUET-390

GroupType.union(Type toMerge, boolean strict) does not honor strict parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • parquet-mr

    Description

      This is the code as it currently stands in master:

      @Override
      protected Type union(Type toMerge, boolean strict) {
        if (toMerge.isPrimitive()) {
          throw new IncompatibleSchemaModificationException("can not merge primitive type " + toMerge + " into group type " + this);
        }
        return new GroupType(toMerge.getRepetition(), getName(), mergeFields(toMerge.asGroupType()));
      }
      

      Note the call to mergeFields omits the strict parameter. I believe the code should be:

      @Override
      protected Type union(Type toMerge, boolean strict) {
        if (toMerge.isPrimitive()) {
          throw new IncompatibleSchemaModificationException("can not merge primitive type " + toMerge + " into group type " + this);
        }
        return new GroupType(toMerge.getRepetition(), getName(), mergeFields(toMerge.asGroupType(), strict));
      }
      

      Note the call to mergeFields includes the strict parameter.

      I would work on this myself, but I'm having considerable trouble working with the codebase (see e.g. http://stackoverflow.com/questions/31229445/build-failure-apache-parquet-mr-source-mvn-install-failure). Given the (assumed) simplicity of the fix, can a seasoned Parquet contributor take this up? Cheers.

      Attachments

        Activity

          People

            Unassigned Unassigned
            michael Michael MacFadden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: