@Test public void testIsNullCheck() { for (int i = 0; i < 16; i++) { Object[] values = getRandomValue(true); InternalRow row = new GenericInternalRow(values); HoodieInternalRow hoodieInternalRow = new HoodieInternalRow("commitTime", "commitSeqNo", "recordKey", "partitionPath", "fileName", row); hoodieInternalRow.setNullAt(i); nullIndices.clear(); nullIndices.add(i); assertValues(hoodieInternalRow, "commitTime", "commitSeqNo", "recordKey", "partitionPath", "fileName", values, nullIndices); } 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("commitTime", "commitSeqNo", "recordKey", "partitionPath", "fileName", row); nullIndices.clear(); for (Integer index : nullsSoFar) { hoodieInternalRow.setNullAt(index); nullIndices.add(index); } assertValues(hoodieInternalRow, "commitTime", "commitSeqNo", "recordKey", "partitionPath", "fileName", values, nullIndices); } }
@Override public void setNullAt(int i) { if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) { switch (i) { case 0: { this.commitTime = null; break; } case 1: { this.commitSeqNumber = null; break; } case 2: { this.recordKey = null; break; } case 3: { this.partitionPath = null; break; } case 4: { this.fileName = null; break; } default: throw new IllegalArgumentException("Not expected"); } } else { row.setNullAt(i); } }
HoodieInternalRow extends InternalRow { @Override public void setNullAt(int i) { if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) { switch (i) { case 0: { this.commitTime = null; break; } case 1: { this.commitSeqNumber = null; break; } case 2: { this.recordKey = null; break; } case 3: { this.partitionPath = null; break; } case 4: { this.fileName = null; break; } default: throw new IllegalArgumentException("Not expected"); } } else { row.setNullAt(i); } } }
HoodieInternalRow extends InternalRow { @Override public void setNullAt(int i) { if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) { switch (i) { case 0: { this.commitTime = null; break; } case 1: { this.commitSeqNumber = null; break; } case 2: { this.recordKey = null; break; } case 3: { this.partitionPath = null; break; } case 4: { this.fileName = null; break; } default: throw new IllegalArgumentException("Not expected"); } } else { row.setNullAt(i); } } HoodieInternalRow(String commitTime, String commitSeqNumber, String recordKey, String partitionPath,
      String fileName, InternalRow row); }
HoodieInternalRow extends InternalRow { @Override public void setNullAt(int i) { if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) { switch (i) { case 0: { this.commitTime = null; break; } case 1: { this.commitSeqNumber = null; break; } case 2: { this.recordKey = null; break; } case 3: { this.partitionPath = null; break; } case 4: { this.fileName = null; break; } default: throw new IllegalArgumentException("Not expected"); } } else { row.setNullAt(i); } } HoodieInternalRow(String commitTime, String commitSeqNumber, String recordKey, String partitionPath,
      String fileName, InternalRow row); @Override int numFields(); @Override void setNullAt(int i); @Override void update(int i, Object value); @Override boolean isNullAt(int ordinal); @Override boolean getBoolean(int ordinal); @Override byte getByte(int ordinal); @Override short getShort(int ordinal); @Override int getInt(int ordinal); @Override long getLong(int ordinal); @Override float getFloat(int ordinal); @Override double getDouble(int ordinal); @Override Decimal getDecimal(int ordinal, int precision, int scale); @Override UTF8String getUTF8String(int ordinal); @Override String getString(int ordinal); @Override byte[] getBinary(int ordinal); @Override CalendarInterval getInterval(int ordinal); @Override InternalRow getStruct(int ordinal, int numFields); @Override ArrayData getArray(int ordinal); @Override MapData getMap(int ordinal); @Override Object get(int ordinal, DataType dataType); @Override InternalRow copy(); }
HoodieInternalRow extends InternalRow { @Override public void setNullAt(int i) { if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) { switch (i) { case 0: { this.commitTime = null; break; } case 1: { this.commitSeqNumber = null; break; } case 2: { this.recordKey = null; break; } case 3: { this.partitionPath = null; break; } case 4: { this.fileName = null; break; } default: throw new IllegalArgumentException("Not expected"); } } else { row.setNullAt(i); } } HoodieInternalRow(String commitTime, String commitSeqNumber, String recordKey, String partitionPath,
      String fileName, InternalRow row); @Override int numFields(); @Override void setNullAt(int i); @Override void update(int i, Object value); @Override boolean isNullAt(int ordinal); @Override boolean getBoolean(int ordinal); @Override byte getByte(int ordinal); @Override short getShort(int ordinal); @Override int getInt(int ordinal); @Override long getLong(int ordinal); @Override float getFloat(int ordinal); @Override double getDouble(int ordinal); @Override Decimal getDecimal(int ordinal, int precision, int scale); @Override UTF8String getUTF8String(int ordinal); @Override String getString(int ordinal); @Override byte[] getBinary(int ordinal); @Override CalendarInterval getInterval(int ordinal); @Override InternalRow getStruct(int ordinal, int numFields); @Override ArrayData getArray(int ordinal); @Override MapData getMap(int ordinal); @Override Object get(int ordinal, DataType dataType); @Override InternalRow copy();  }