the-other-tim-brown commented on code in PR #13686:
URL: https://github.com/apache/hudi/pull/13686#discussion_r2263154314


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieAvroIndexedRecord.java:
##########
@@ -122,43 +152,54 @@ public Object[] getColumnValues(Schema recordSchema, 
String[] columns, boolean c
 
   @Override
   public Object getColumnValueAsJava(Schema recordSchema, String column, 
Properties props) {
+    setSchema(recordSchema);
     return AvroRecordContext.getFieldValueFromIndexedRecord(data, column);
   }
 
   @Override
   public HoodieRecord joinWith(HoodieRecord other, Schema targetSchema) {
+    setSchema(targetSchema);
     GenericRecord record = HoodieAvroUtils.stitchRecords((GenericRecord) data, 
(GenericRecord) other.getData(), targetSchema);
     return new HoodieAvroIndexedRecord(key, record, operation, metaData);
   }
 
   @Override
   public HoodieRecord prependMetaFields(Schema recordSchema, Schema 
targetSchema, MetadataValues metadataValues, Properties props) {
+    setSchema(recordSchema);
     GenericRecord newAvroRecord = 
HoodieAvroUtils.rewriteRecordWithNewSchema(data, targetSchema);
     updateMetadataValuesInternal(newAvroRecord, metadataValues);
     return new HoodieAvroIndexedRecord(key, newAvroRecord, operation, 
metaData);
   }
 
   @Override
   public HoodieRecord updateMetaField(Schema recordSchema, int ordinal, String 
value) {
+    setSchema(recordSchema);
     data.put(ordinal, value);
     return new HoodieAvroIndexedRecord(key, data, operation, metaData);
   }
 
   @Override
   public HoodieRecord rewriteRecordWithNewSchema(Schema recordSchema, 
Properties props, Schema newSchema, Map<String, String> renameCols) {
+    setSchema(recordSchema);
     GenericRecord record = HoodieAvroUtils.rewriteRecordWithNewSchema(data, 
newSchema, renameCols);
     return new HoodieAvroIndexedRecord(key, record, operation, metaData);
   }
 
   @Override
   public HoodieRecord truncateRecordKey(Schema recordSchema, Properties props, 
String keyFieldName) {
+    setSchema(recordSchema);
     ((GenericRecord) data).put(keyFieldName, StringUtils.EMPTY_STRING);
     return this;
   }
 
   @Override
   public boolean isDelete(Schema recordSchema, Properties props) {
-    return false;
+    if (getData().equals(SENTINEL)) {
+      return false; // Sentinel record is not a delete
+    }
+    setSchema(recordSchema);
+    DeleteContext deleteContext = new DeleteContext(props, recordSchema);

Review Comment:
   I'm not sure where we would cache the context. Right now this will match our 
current performance with the payload records so I'm not sure it is worth the 
complexity of a cache. 



##########
hudi-common/src/main/java/org/apache/hudi/common/engine/RecordContext.java:
##########
@@ -70,6 +70,15 @@ protected RecordContext(HoodieTableConfig tableConfig) {
         .orElseThrow(() -> new IllegalArgumentException("No record keys 
specified and meta fields are not populated")));
   }
 
+  /**
+   * Constructs an instance of {@link RecordContext} that provides field 
accessor methods but cannot compute the record key for records.
+   */
+  protected RecordContext() {

Review Comment:
   Yes, updating now



-- 
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]

Reply via email to