VladBanar commented on code in PR #3447:
URL: https://github.com/apache/fluss/pull/3447#discussion_r3467363133
##########
fluss-client/src/main/java/org/apache/fluss/client/converter/ConverterCommons.java:
##########
@@ -171,13 +180,17 @@ public static String charLengthExceptionMessage(String
fieldName, int length) {
}
static BinaryString toBinaryStringForText(Object v, String fieldName,
DataTypeRoot root) {
- final String s = String.valueOf(v);
+ final String s = objectToString(v);
if (root == DataTypeRoot.CHAR && s.length() != 1) {
throw new
IllegalArgumentException(charLengthExceptionMessage(fieldName, s.length()));
}
return BinaryString.fromString(s);
}
+ private static String objectToString(Object v) {
+ return v != null && v.getClass().isEnum() ? ((Enum<?>) v).name() :
String.valueOf(v);
Review Comment:
@fresh-borzoni done
--
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]