featzhang commented on code in PR #28144:
URL: https://github.com/apache/flink/pull/28144#discussion_r3228549765
##########
flink-table/flink-table-type-utils/src/test/java/org/apache/flink/table/data/DataStructureConvertersTest.java:
##########
@@ -595,6 +598,13 @@ private static Map<LocalDate, Integer>
createLocalDateMultiset() {
// Structured types
//
--------------------------------------------------------------------------------------------
+ private enum ConverterEnum {
+ FIRST,
+ SECOND
+ }
Review Comment:
The test covers `DetailedEnum` with additional fields, which is good. It
verifies that the enum constant name is used regardless of extra state.
One missing test case: enum constant name mismatches. For example:
```java
DataStructureConverter converter = StringEnumConverter.create(
DataTypes.STRING().bridgedTo(ConverterEnum.class));
// Should throw IllegalArgumentException
converter.toExternal(StringData.fromString("INVALID"));
```
This would verify the error path and document the expected behavior when
data doesn't match the enum.
--
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]