docs: @SuppressWarnings("unchecked")
      @Override
      public void write(Record record) throws IOException, InterruptedException {
          if (record.isKeyEmpty()) {
              defaultRecord.getKey().getSort().clear();
              record.setKey(defaultRecord.getKey());
          } else {
              if (record.getKey().isGroupingEmpty() &&
                  !record.getKey().isSortEmpty()) {
                  record.getKey().setGrouping(defaultRecord.getKey().getGrouping());
              }
          }
  
          if (record.isValueEmpty()) {
              record.setValue(defaultRecord.getValue());
          }
  
          if (!label) {
              for (ValueWritable vw : record.getKey().getGrouping()) {
                  vw.getLabel().clear();
              }
              for (ValueWritable vw : record.getValue().getValues()) {
                  vw.getLabel().clear();
              }
          }
  
          context.write(record.isGroupingNothing() ? NullWritable.get() : record.getKey(),
                        record.isValueNothing() ? NullWritable.get() : record.getValue());
      }