manojpec commented on a change in pull request #4067:
URL: https://github.com/apache/hudi/pull/4067#discussion_r764357736
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieHFileDataBlock.java
##########
@@ -104,27 +106,30 @@ public HoodieLogBlockType getBlockType() {
HFile.Writer writer = HFile.getWriterFactory(conf, cacheConfig)
.withOutputStream(ostream).withFileContext(context).create();
- // Serialize records into bytes
+ // Serialize records into bytes, sort them and write to HFile
Map<String, byte[]> sortedRecordsMap = new TreeMap<>();
Iterator<IndexedRecord> itr = records.iterator();
boolean useIntegerKey = false;
int key = 0;
int keySize = 0;
- Field keyField = records.get(0).getSchema().getField(this.keyField);
- if (keyField == null) {
- // Missing key metadata field so we should use an integer sequence key
+
+ // Build the record key
+ final Field schemaKeyField =
records.get(0).getSchema().getField(this.keyField);
+ if (schemaKeyField == null) {
+ // Missing key metadata field. Use an integer sequence key instead.
Review comment:
Filed https://issues.apache.org/jira/browse/HUDI-2954 to track this.
--
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]