szehon-ho commented on code in PR #11555: URL: https://github.com/apache/iceberg/pull/11555#discussion_r1874217873
########## core/src/main/java/org/apache/iceberg/util/ContentFileUtil.java: ########## @@ -60,28 +69,63 @@ public static CharSequence referencedDataFile(DeleteFile deleteFile) { return deleteFile.referencedDataFile(); } - int pathId = MetadataColumns.DELETE_FILE_PATH.fieldId(); - Type pathType = MetadataColumns.DELETE_FILE_PATH.type(); - Map<Integer, ByteBuffer> lowerBounds = deleteFile.lowerBounds(); - ByteBuffer lowerPathBound = lowerBounds != null ? lowerBounds.get(pathId) : null; + ByteBuffer lowerPathBound = lowerBounds != null ? lowerBounds.get(PATH_ID) : null; if (lowerPathBound == null) { return null; } Map<Integer, ByteBuffer> upperBounds = deleteFile.upperBounds(); - ByteBuffer upperPathBound = upperBounds != null ? upperBounds.get(pathId) : null; + ByteBuffer upperPathBound = upperBounds != null ? upperBounds.get(PATH_ID) : null; if (upperPathBound == null) { return null; } if (lowerPathBound.equals(upperPathBound)) { - return Conversions.fromByteBuffer(pathType, lowerPathBound); + return Conversions.fromByteBuffer(PATH_TYPE, lowerPathBound); } else { return null; } } + /** + * Replace file_path reference for a delete file entry + * + * @param deleteFile delete file whose entry will be replaced + * @param sourcePrefix source prefix which will be replaced + * @param targetPrefix target prefix which will replace it + * @return metrics for the new delete file entry + */ + public static Metrics replacePathBounds( Review Comment: this new logic is to rewrite the position delete entry's file_path bounds, which are used in the delete index. now we moved the position delete rewrite to a separate spark job instead of inline with writing the delete entry, we need to fix the bounds for the metadata here. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org