@Test public void testInvalidPartitionKeyType() { try { KeyGenerator keyGenerator = new CustomKeyGenerator(getInvalidPartitionKeyTypeProps()); keyGenerator.getKey(getRecord()); Assertions.fail("should fail when invalid PartitionKeyType is provided!"); } catch (Exception e) { Assertions.assertTrue(e.getMessage().contains("No enum constant org.apache.hudi.keygen.CustomKeyGenerator.PartitionKeyType.DUMMY")); } try { KeyGenerator keyGenerator = new CustomKeyGenerator(getInvalidPartitionKeyTypeProps()); GenericRecord record = getRecord(); Row row = KeyGeneratorTestUtilities.getRow(record); keyGenerator.getPartitionPath(row); Assertions.fail("should fail when invalid PartitionKeyType is provided!"); } catch (Exception e) { Assertions.assertTrue(e.getMessage().contains("No enum constant org.apache.hudi.keygen.CustomKeyGenerator.PartitionKeyType.DUMMY")); } }
@Override public String getPartitionPath(Row row) { return getPartitionPath(Option.empty(), Option.of(row)); }
CustomKeyGenerator extends BuiltinKeyGenerator { @Override public String getPartitionPath(Row row) { return getPartitionPath(Option.empty(), Option.of(row)); } }
CustomKeyGenerator extends BuiltinKeyGenerator { @Override public String getPartitionPath(Row row) { return getPartitionPath(Option.empty(), Option.of(row)); } CustomKeyGenerator(TypedProperties props); }
CustomKeyGenerator extends BuiltinKeyGenerator { @Override public String getPartitionPath(Row row) { return getPartitionPath(Option.empty(), Option.of(row)); } CustomKeyGenerator(TypedProperties props); @Override String getPartitionPath(Row row); @Override String getPartitionPath(GenericRecord record); @Override String getRecordKey(GenericRecord record); @Override String getRecordKey(Row row); }
CustomKeyGenerator extends BuiltinKeyGenerator { @Override public String getPartitionPath(Row row) { return getPartitionPath(Option.empty(), Option.of(row)); } CustomKeyGenerator(TypedProperties props); @Override String getPartitionPath(Row row); @Override String getPartitionPath(GenericRecord record); @Override String getRecordKey(GenericRecord record); @Override String getRecordKey(Row row);  }