@Override
  public void setNullAt(int ordinal) {
    if (ordinal < metaFields.length) {
      metaFields[ordinal] = null;
    } else {
      sourceRow.setNullAt(rebaseOrdinal(ordinal));
    }
  }
@Test
  public void testIsNullCheck() {

    for (int i = 0; i < 16; i++) {
      Object[] values = getRandomValue(true);

      InternalRow row = new GenericInternalRow(values);
      HoodieInternalRow hoodieInternalRow = new HoodieInternalRow(UTF8String.fromString("commitTime"),
          UTF8String.fromString("commitSeqNo"),
          UTF8String.fromString("recordKey"),
          UTF8String.fromString("partitionPath"),
          UTF8String.fromString("fileName"),
          row,
          true);

      hoodieInternalRow.setNullAt(i);
      nullIndices.clear();
      nullIndices.add(i);
      assertValues(hoodieInternalRow, "commitTime", "commitSeqNo", "recordKey", "partitionPath",
          "fileName", values, nullIndices);
    }

    // try setting multiple values as null
    // run it for 5 rounds
    for (int i = 0; i < 5; i++) {
      int numNullValues = 1 + RANDOM.nextInt(4);
      List<Integer> nullsSoFar = new ArrayList<>();
      while (nullsSoFar.size() < numNullValues) {
        int randomIndex = RANDOM.nextInt(16);
        if (!nullsSoFar.contains(randomIndex)) {
          nullsSoFar.add(randomIndex);
        }
      }

      Object[] values = getRandomValue(true);
      InternalRow row = new GenericInternalRow(values);
      HoodieInternalRow hoodieInternalRow = new HoodieInternalRow(UTF8String.fromString("commitTime"),
          UTF8String.fromString("commitSeqNo"),
          UTF8String.fromString("recordKey"),
          UTF8String.fromString("partitionPath"),
          UTF8String.fromString("fileName"),
          row,
          true);

      nullIndices.clear();

      for (Integer index : nullsSoFar) {
        hoodieInternalRow.setNullAt(index);
        nullIndices.add(index);
      }
      assertValues(hoodieInternalRow, "commitTime", "commitSeqNo", "recordKey", "partitionPath",
          "fileName", values, nullIndices);
    }
  }