yihua commented on code in PR #12145:
URL: https://github.com/apache/hudi/pull/12145#discussion_r1811701192
##########
hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java:
##########
@@ -1259,14 +1260,16 @@ public static boolean
recordNeedsRewriteForExtendedAvroTypePromotion(Schema writ
* int, long, float, double, or bytes because avro doesn't support evolution
from those types to
* string so some intervention is needed
*/
- private static boolean needsRewriteToString(Schema schema) {
+ private static boolean needsRewriteToString(Schema schema, boolean isEnum) {
switch (schema.getType()) {
case INT:
case LONG:
case FLOAT:
case DOUBLE:
case BYTES:
return true;
+ case ENUM:
+ return !isEnum;
Review Comment:
Could you create a follow-up Jira to revisit how the reader schema is
decided for the log reader in the file group reader? As a fix to account for
type promotion, it is OK. Ideally, the issue should be fixed by passing in the
correct reader schema with the right field type.
--
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]