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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/common/model/HoodieSparkRecord.java:
##########
@@ -404,21 +400,24 @@ protected final InternalRow readRecordPayload(Kryo kryo, 
Input input) {
   }
 
   @Override
-  public Object convertColumnValueForLogicalType(Schema fieldSchema,
+  public Object convertColumnValueForLogicalType(HoodieSchema fieldSchema,
                                                  Object fieldValue,
                                                  boolean 
keepConsistentLogicalTimestamp) {
     if (fieldValue == null) {
       return null;
     }
-    LogicalType logicalType = fieldSchema.getLogicalType();
+    HoodieSchemaType schemaType = fieldSchema.getType();
 
-    if (logicalType == LogicalTypes.date()) {
+    if (schemaType == HoodieSchemaType.DATE) {
       return LocalDate.ofEpochDay(((Integer) fieldValue).longValue());
-    } else if (logicalType == LogicalTypes.timestampMillis() && 
keepConsistentLogicalTimestamp) {
-      return (Long) fieldValue;
-    } else if (logicalType == LogicalTypes.timestampMicros() && 
keepConsistentLogicalTimestamp) {
-      return ((Long) fieldValue) / 1000;
-    } else if (logicalType instanceof LogicalTypes.Decimal) {
+    } else if (schemaType == HoodieSchemaType.TIMESTAMP && 
keepConsistentLogicalTimestamp) {
+      HoodieSchema.Timestamp timestampSchema = (HoodieSchema.Timestamp) 
fieldSchema;
+      if 
(timestampSchema.getPrecision().equals(HoodieSchema.TimePrecision.MILLIS)) {

Review Comment:
   one nitpick here, here the enum comparisons you can just use `==`



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