the-other-tim-brown commented on code in PR #13097:
URL: https://github.com/apache/hudi/pull/13097#discussion_r2033830648
##########
hudi-hadoop-common/src/test/java/org/apache/hudi/metadata/TestHoodieTableMetadataUtil.java:
##########
@@ -652,6 +652,27 @@ public void testValidateDataTypeForPartitionStats() {
.name("dateField").type(dateFieldSchema).noDefault()
.endRecord();
assertTrue(HoodieTableMetadataUtil.isColumnTypeSupported(schema.getField("dateField").schema(),
Option.empty()));
+
+ // Test for logical decimal type with allowed precision and scale
+ schema = Schema.create(Schema.Type.BYTES);
+ LogicalTypes.Decimal decimalType = LogicalTypes.decimal(30, 15);
+ decimalType.addToSchema(schema);
+ // Expect the column to be supported.
+ assertTrue(HoodieTableMetadataUtil.isColumnTypeSupported(schema,
Option.of(HoodieRecord.HoodieRecordType.AVRO)));
+
+ // Test for logical decimal type with precision and scale exceeding the
limit
Review Comment:
We should have tests where just 1 or the other exceeds as well to ensure the
scale condition is hit in our testing.
--
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]