nsivabalan commented on code in PR #17495:
URL: https://github.com/apache/hudi/pull/17495#discussion_r2733942636
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java:
##########
@@ -2350,6 +2350,10 @@ public long getHFileMaxFileSize() {
return getLong(HoodieStorageConfig.HFILE_MAX_FILE_SIZE);
}
+ public boolean isAllowDuplicatesWithHfileWritesEnabled() {
Review Comment:
minor.
we can just name the method `allowDuplicatesWithHfileWrites`
##########
hudi-hadoop-common/src/main/java/org/apache/hudi/io/storage/hadoop/HoodieAvroHFileWriter.java:
##########
@@ -127,9 +130,12 @@ public boolean canWrite() {
@Override
public void writeAvro(String recordKey, IndexedRecord record) throws
IOException {
- if (prevRecordKey.equals(recordKey)) {
- throw new HoodieDuplicateKeyException("Duplicate recordKey " + recordKey
+ " found while writing to HFile."
- + "Record payload: " + record);
+ if (!this.hfileConfig.isAllowDuplicatesOnHfileWrites()) {
+ // When this config is enabled, do not allow duplicates to be written to
hFile.
Review Comment:
minor. the comment needs to be fixed.
`When this config is not enabled, do not allow duplicates to be written to
hFile.`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]