nsivabalan commented on code in PR #12594:
URL: https://github.com/apache/hudi/pull/12594#discussion_r1911156788
##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieDataBlock.java:
##########
@@ -84,19 +86,32 @@ public HoodieDataBlock(List<HoodieRecord> records,
Map<FooterMetadataType, String> footer,
String keyFieldName) {
super(header, footer, Option.empty(), Option.empty(), null, false);
- if (shouldWriteRecordPositions) {
- records.sort((o1, o2) -> {
- long v1 = o1.getCurrentPosition();
- long v2 = o2.getCurrentPosition();
- return Long.compare(v1, v2);
- });
- if (isPositionValid(records.get(0).getCurrentPosition())) {
- addRecordPositionsToHeader(
-
records.stream().map(HoodieRecord::getCurrentPosition).collect(Collectors.toSet()),
- records.size());
+ if (shouldWriteRecordPositions && !records.isEmpty()) {
+ String baseFileInstantTime =
records.get(0).getCurrentBaseFileInstantTime();
+ for (HoodieRecord record : records) {
+ if
(!baseFileInstantTime.equals(record.getCurrentBaseFileInstantTime())) {
+ baseFileInstantTime = EMPTY_STRING;
+ break;
+ }
+ }
+ if (StringUtils.isNullOrEmpty(baseFileInstantTime)) {
+ LOG.warn("Base file instant time of delete positions cannot be
determined, possibly "
Review Comment:
fix logging. this is not delete blocks. why talk about delete positions
--
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]