alexeykudinkin commented on code in PR #6986:
URL: https://github.com/apache/hudi/pull/6986#discussion_r1007294815


##########
hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java:
##########
@@ -874,21 +887,30 @@ private static Object 
rewritePrimaryTypeWithDiffSchemaType(Object oldValue, Sche
     switch (newSchema.getType()) {
       case NULL:
       case BOOLEAN:
+        if (oldSchema.getType() == Schema.Type.STRING) {

Review Comment:
   Also i'd suggest you to check out `Spark3ParsePartitionUtil`



##########
hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java:
##########
@@ -874,21 +887,30 @@ private static Object 
rewritePrimaryTypeWithDiffSchemaType(Object oldValue, Sche
     switch (newSchema.getType()) {
       case NULL:
       case BOOLEAN:
+        if (oldSchema.getType() == Schema.Type.STRING) {

Review Comment:
   Appreciate your approach of extending existing functionality, but i think in 
that case we actually shouldn't be doing that -- conversions we're doing here 
aren't "canonical" (there's no permitted conversion from string to int, for ex 
in Spark) and as such, we'd rather keep this conversion limited in scope to be 
applicable only to partition values where it's both inevitable and is actually 
sensible (since we know that we're not trying to convert some random string to 
int, but the int that was previously converted to a string)



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