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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/common/model/HoodieSparkRecord.java:
##########
@@ -389,8 +389,10 @@ public Comparable<?> getOrderingValueAsJava(HoodieSchema 
recordSchema, Propertie
     if (orderingFields == null) {
       return OrderingValues.getDefault();
     } else {
+      StructType structType = 
HoodieInternalRowUtils.getCachedSchema(recordSchema);
       return OrderingValues.create(orderingFields, field -> {
-        if (recordSchema.getField(field).isEmpty()) {
+        // Ordering fields can be nested, so resolve them by path as 
doGetOrderingValue does.
+        if (HoodieInternalRowUtils.getCachedPosList(structType, 
field).isEmpty()) {

Review Comment:
   the `HoodieInternalRowUtils.getCachedSchema` and 
`HoodieInternalRowUtils.getCachedPosList` could be called again once go into 
`getColumnValueAsJava`, since this is a per-row function call, could we try to 
eliminate the redundant calls.



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