xushiyan commented on code in PR #8758:
URL: https://github.com/apache/hudi/pull/8758#discussion_r1233576387
##########
hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieAvroHFileWriter.java:
##########
@@ -126,6 +131,15 @@ public boolean canWrite() {
@Override
public void writeAvro(String recordKey, IndexedRecord record) throws
IOException {
+ if (prevRecordKey.equals(recordKey)) {
+ // When this config is enabled, do not allow duplicates to be written to
hFile.
+ LOG.warn("Duplicate recordKey " + recordKey + " found while writing to
HFile. Record payload " + record);
+ if (this.hfileConfig.allowDuplicatesToBeInserted()) {
+ return;
+ } else {
+ throw new HoodieDuplicateKeyException("Duplicate recordKey " +
recordKey + " found while writing to HFile.");
+ }
+ }
Review Comment:
ignore this. we should just remove this config and disallow dups
--
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]