vingov commented on code in PR #5294: URL: https://github.com/apache/hudi/pull/5294#discussion_r848111719
########## hudi-common/src/test/java/org/apache/hudi/avro/TestHoodieAvroUtils.java: ########## @@ -227,6 +228,20 @@ public void testAddingAndRemovingMetadataFields() { assertEquals(NUM_FIELDS_IN_EXAMPLE_SCHEMA, schemaWithoutMetaCols.getFields().size()); } + @Test + public void testRemoveFields() { + GenericRecord rec = new GenericData.Record(new Schema.Parser().parse(EXAMPLE_SCHEMA)); + rec.put("_row_key", "key1"); + rec.put("non_pii_col", "val1"); + rec.put("pii_col", "val2"); + rec.put("timestamp", 3.5); + GenericRecord rec1 = HoodieAvroUtils.removeFields(rec, Arrays.asList("pii_col")); + assertEquals("key1", rec1.get("_row_key")); + assertEquals("val1", rec1.get("non_pii_col")); + assertEquals(3.5, rec1.get("timestamp")); + assertNull(rec1.get("pii_col")); Review Comment: good catch added more tests. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org