danny0405 commented on code in PR #13449:
URL: https://github.com/apache/hudi/pull/13449#discussion_r2160302664


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieCreateHandle.java:
##########
@@ -173,6 +186,23 @@ record = record.prependMetaFields(schema, 
writeSchemaWithMetaFields, new Metadat
     }
   }
 
+  private void trackMetadataIndexStats(HoodieRecord record) {
+    if (isSecondaryIndexStreamingDisabled()) {
+      return;
+    }
+
+    // Add secondary index records for all the inserted records
+    secondaryIndexDefns.forEach(secondaryIndexPartitionPathFieldPair -> {
+      String secondaryIndexSourceField = 
String.join(".",secondaryIndexPartitionPathFieldPair.getValue().getSourceFields());
+      if (record instanceof HoodieAvroIndexedRecord) {

Review Comment:
   > Do we have a way of knowing what the input record type will be when 
constructing the Handle classes?
   
   Why we need to care about that, we have `HoodieRecord.getColumnValueAsJava` 
to read whatever the column as engine agnostic value as Java obj. If you wanna 
engine specific field, use `HoodieReaderContext.getValue` and 
`HoodieReaderContext.convertValueToEngineType`.
   
   I guess here the value should be finally persisted as avro obj like what we 
did to `column_stats`, we can firstly read it as java obj then transform to 
avro obj for specific data types: Utf8, Date and timestamp.



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